views:

53

answers:

2

We use G4 compression for all bitonal scanned images, however, what is the recommended format to save TIF images when they contain color?

+3  A: 

If you need lossless, use LZW. Otherwise, JPEG compression inside TIFF would be unbeatable.

BarsMonster
+1  A: 

I would recommend RGB colorspace and LZW or Deflate compression. If you can't allow lossless compression, then JPEG compression may be used.

libtiff FAQ gives following table for color space and compression schemes:

Bilevel dithered or very complex imagery

colorspace black and white. compression G3, G4, or perhaps JBIG

Bilevel artificial imagery

colorspace black and white. compression G3 or G4

Normal range grayscale or color photographic imagery

If compression is more important than quality then colorspace Grayscale or YCbCr. compression JPEG. The YCbCr color space and JPEG compression scheme are de facto related. Other than using JPEG as compression scheme, there is in our humble opinion no good reason for using YCbCr.

If quality is more important than compression then colorspace Grayscale, RGB, or CIE L*a*b*. compression LZW or Deflate

If quality is of utmost importance colorspace 16bit per channel or even floating point RGB, or 16bit per channel CIE L*a*b*. compression LZW or Deflate

Normal range Grayscale or color artificial imagery

If the number of colors <=256 then colorspace Palette would be most suitable. compression LZW or Deflate.

If the number of colors >256 then colorspace Grayscale, RGB, or CIE L*a*b*. compression LZW or Deflate.

Dynamic range Grayscale or color imagery

colorspace floating point Grayscale or RGB. compression LZW or Deflate

Michael Still gives following table in his "Graphics programming with libtiff, Part 2" article:

CCITT Group 4 Fax and Group 3 Fax

This entry is here for completeness. If you're coding for black and white images, then you're probably using the CCITT fax compression methods. These compression algorithms don't support color.

JPEG

JPEG compression is great for large images such as photos. However, the compression is normally lossy (in that image data is thrown away as part of the compression process). This makes JPEG very poor for compressing text which needs to remain readable. The other thing to bear in mind is that the loss is cumulative - see the next section for more information about this.

LZW

This is the compression algorithm used in GIF images. There were the licensing requirements from Unisys, but this requirements are gone now and this compression codec is useful for certain types of images. See note below.

Deflate

This is the gzip compression algorithm, which is also used for PNG. It is the compression algorithm I would recommend for color images.

Bobrovsky