2000.12.17 23:41 "Re: Stripes in thumbnail", by Joris Van Damme
I'm trying to create a (rgb-)thumbnail out of up to four single separated G4-TIFFs. But creating a thumbnail from these G4s ends up in a grayscale with vertical stripes. An example is here:
The published original G4 tiff file is in turn compressed in some format with the extension bz2, which is unknow to me, and for which I do not have the tools to decompress. So I can't even look at it.
However, I did take a look at the 'vertical stripes' in the thumbnail. It's just a guess, but I think it's very likely a decompression problem. LibTiff fax decompression has been reported to behave differently from other decompressors like eg the one in Photoshop. My guess is that some scanlines in the original g4 tiff(s) cannot be correctly interpretted by LibTiff, and are simply (partially) skipped, leaving a (partially) blank line. Warning and error behaviour of the g3/g4 decompressors has been reported to be imperfect, so it's even possible you don't even get a warning about this, I guess... If you publish the original g4 tiff in a format we can all read, and drop a line here, I'll take a further look at it and see if I can narrow down on the problem. Alternativly, mail the original g4 tiff to my private e-mail account.
Maybe you can even provide me with a snippet of code for composing four singe grayscale into a cmyk-tiff? (well... sitting in front of TIFF6.0 at the moment :)
That would be rather a large snippet, wouldn't it? In fact, even simply a good interface to LibTiff to get the library to simply read any tiff file is already a bit to big to fit in the 'snippet' department... Maybe I can be of service by first breaking down the problem. The way I see it, you need
- code to get LibTiff to read the original grayscale files
- code to convert an image from grayscale to cmyk
- code to get LibTiff to write the cmyk image
You should be able to handle the first and third with the aid of the LibTiff docs. If you have any additional questions (preferably more specific, if you expect an answer), just ask 'em.
I can elaborate on one way to get you started on the second task. Photoshop can save .ast files, which contain a lut to convert between lab and cmyk. The Photoshop SDK docs contain more info about this. So, one way would be to convert grayscale (which is essentially RGB, with r=g=b) to Y (XYZ with X=0 and Z=0), Y to L (Lab with a=0 and b=0) and finally L to CMYK using an .ast file/lut.