AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

1998.02.10 13:12 "Tiff JPEG compression for CMYK images", by Olaf Than
1998.02.10 22:12 "Re: Tiff JPEG compression for CMYK images", by Tom Lane
1998.02.11 12:41 "AW: Tiff JPEG compression for CMYK images", by Olaf Than
1998.02.11 14:58 "Re: AW: Tiff JPEG compression for CMYK images", by Tom Lane

1998.02.11 12:41 "AW: Tiff JPEG compression for CMYK images", by Olaf Than

Dear Mr Lane,

   on 30. Sep 1997 youu wrote:

>Bill Rizzi <rizzi@softserv.com> writes:
>> #if 1
>> /* RIZZI - so we pass check in jinit_color_converter()
*/
>> sp->cinfo.c.input_components =
sp->cinfo.c.num_components;
>> #endif
>
>This change should not be necessary. In my copy of tif_jpeg.c, line
1055
>(just above the segment you quote) reads
>
> sp->cinfo.c.input_components = td->td_samplesperpixel;
>
>Assuming that what you are passing in is indeed RGB data, this should
>set input_components correctly. If the resulting value is not 3 then
it
>is appropriate for libjpeg to complain, because the input data will in
>fact not be in the format libjpeg expects.
>
>So, I think your change will fix no problems and will create some.
>
>If you are trying to compress data in which SamplesPerPixel is not 3
>(perhaps there is an alpha channel?) you will need to make some fairly
>extensive additions to tif_jpeg.c and/or libjpeg. Or else don't set
>PhotometricInterpretation to YCbCr. Basically, the existing code in
>tif_jpeg.c is only prepared to provide automatic RGB<->YCbCr conversion
>if your data is exactly 3 channels --- it depends on libjpeg which is
>unwilling to munge a colorspace that it doesn't fully understand. But
>you can bypass the need for colorspace conversion, at the cost of some
>compression effectiveness, by setting PhotometricInterpretation to RGB.

I think CMYK has 4 channels. I have nearly the same problem as Bill Rizzi. So in this mail you wrote:

>If you are trying to compress data in which SamplesPerPixel is not 3
>(perhaps there is an alpha channel?) you will need to make some fairly
>extensive additions to tif_jpeg.c and/or libjpeg.

I use libtiff 3.4beta. Maybe there is a patch which fix my problem. May be my question is not good.. So my question now:

Can i write a class "JPEG" image using libtiff and IJG jpeg-6a with

PhotometricInterpretation = 5 (CMYK)
Commpression = 6 (JPEG)
JPEGProc = 1
JPEGquality = xx

?

Thanks

Olaf