0

Compression in TIFF_CCITTFAX3 or TIFF_CCITTFAX4 does not work properly, the resulting file is always in TIFF_LZW format

Ex :

FreeImage.Save(FREE_IMAGE_FORMAT.FIF_TIFF, dib, outFileName, FREE_IMAGE_SAVE_FLAGS.TIFF_CCITTFAX3);

how to solve this problem ?

Thanks Njara

Njara
  • 1
  • 1
  • Is your DIB 1 bit per pixel? FreeImageNet may be using a fallback compression if you feed it the wrong bit depth. – BitBank Feb 12 '15 at 06:41

1 Answers1

0

The solution is to convert color image to monochrome before saving

//dib = FreeImage.Threshold(dib, 128);
dib = FreeImage.Dither(dib, FREE_IMAGE_DITHER.FID_CLUSTER6x6);
//dib = FreeImage.ConvertColorDepth(dib, FREE_IMAGE_COLOR_DEPTH.FICD_01_BPP);
FreeImage.Save(FREE_IMAGE_FORMAT.FIF_TIFF, dib, outFileName, FREE_IMAGE_SAVE_FLAGS.TIFF_CCITTFAX4);

Thanks

Njara
  • 1
  • 1