AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
February 1998

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



Thread

1998.02.11 12:41 "AW: Tiff JPEG compression for CMYK images", by Than Olaf
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 Than Olaf

   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.
>
>			regards, tom lane
>			organizer, Independent JPEG Group
>

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




> -----Ursprüngliche Nachricht-----
> Von:	Tom Lane [SMTP:tgl@sss.pgh.pa.us]
> Gesendet am:	Dienstag, 10. Februar 1998 23:13
> An:	Than.Olaf
> Cc:	'tiff@sgi.com'
> Betreff:	Re: Tiff JPEG compression for CMYK images 
> 
> > Am i correct in assuming that libtiff and IJG jpeg-6a does not
> support
> > jpeg compression for cmyk images?
> 
> No, you are not.  It should work.  I say "should" because we've been
> unable to find any other implementations for cross-testing.
> 
> If you intend to exchange TIFF/JPEG images with other applications,
> you will need to discover whether those apps support the
> TIFF Tech Note #2 flavor of TIFF/JPEG.
> 
> 			regards, tom lane
> 			organizer, Independent JPEG Group