2002.09.30 22:09 "Error message with tiffcp", by Mujtaba Ali

2002.10.01 10:49 "Re: Error message with tiffcp", by Andrey Kiselev

I get the following error with tiffcp"

bash-2.05# tiffcp -c jpeg fax.tif fax.jpg
JPEGSetupEncode: BitsPerSample 1 not allowed for JPEG.

I don't have that much experience with image formats. Can anyone please shed some light on what other command line options I might need? I have read over the man page a couple times and can't figure it out.

JPEG compression of the 1-bit image planes are not supported by the libtiff. You should convert your image to the grayscale or RGB colour space before applying JPEG.

This could be done by the folloowing sequence:

$ tiff2rgba -n fax.tif fax2.tif
$ tiff2bw -c jpeg fax2.tif fax3.tif

fax3.tif will be JPEG compressed.

Note, that this will not be pure JPEG-file, but JPEG incapsulated in TIFF. Other compression methods, like PackBits, will give you better results for your 1-bit images.

If you want to produce pure JPEG-images you need other tools, for example, ImageMagick (http://www.imagemagick.org/):

$ convert fax.tif fax.jpg

should be enough for your task.

Andrey V. Kiselev
Scientific Research Center for Ecological Safety Russian Academy of Sciences
Office phone: +7 812 2307834 ICQ UIN 26871517
Registered Linux user number 169907