2009.09.07 10:53 "[Tiff] tiff2ps : LZW compression fails for some images", by Peter C

2009.09.08 02:07 "Re: [Tiff] tiff2ps : LZW compression fails for some images", by Peter C

I did a google search, I think you meant "LZW-related bug in tif_read.c and/or bug in various LZW encoders" post, right?

It is slightly different from your case, I try to get libTIFF to produce suitable LZW compressed image for postscript. After tests & experiment, I came to conclude that there are many LZW encoder/decoder variant out there and also Postscript LZW implementation is different from TIFF 5 specs. I have about a thousand gray TIFF files for testing, each time I try different TIFF encoders (which also include tiff2ps), some postscript files fails to RIP properly. Each LZW encoder produce different set of postscript files of RIP failure.

There is one constant though, the LZW decoder is the same for the RIP & distillers I tried. Too bad Adobe did not release source code for LZW encoding, probably due to LZW patent issue many years ago. The description on LZW on PostScript Language Reference Manual is rather brief. Unable to find suitable LZW encoder, I might have to use either run length (arrgh!) or JPEG.

On Sep 8, 2009, at 1:03 AM, Andreas Kleinert wrote:

Did you see my previous posting on LZW issues? Is your error similar?

Peter C schrieb:

I found some LZW compress image (postscript files) produce by tiff2ps does not interpret correctly on RIP or distiller. My current project requires LZW to support postscript level 2. The tests is done on libtiff 3.9.1 and image files is gray scale TIFF. RIP/distiller tested, ghostscript 8.7, Preview.app (Mac OS X) and Acrobat 9 distiller, all fail for the some files.

Has anyone encounter this before?

=====================

This is slightly off topic. After experimenting with many LZW encoding implementations, some source codes on the net and did one on my own. I am unable to get a reliable LZW encoding code for postscript file generation. Somehow it is a mystery, on how LZW is implemented for postscript.