on my computer I'm running Fedora FC27, ImageMagick version is
Code: Select all
$ rpm -qa | grep ImageMagick
ImageMagick-6.9.9.27-1.fc27.x86_64
ImageMagick-libs-6.9.9.27-1.fc27.x86_64
I'm using a BASH-script which does the following:
1) scanning into TIFF-file(s) (SANE's scanimage)
2) create multipage-TIFF (LibTIFF's tiffcp)
3) image optimization into multipage-TIFF (ImageMagick's convert)
4) convert multipage-TIFF to PDF (LibTIFF's tiff2pdf)
Beside general image optimization I want to shrink file size by using ImageMagick's option "-posterize <level>" without dithering.
The TIFF-file(s) to convert all have a color-depth of 8bit (grayscale or sRGB) in the beginning.
Resulting TIFF-file grayscale (high posterize color-level):
Code: Select all
convert +dither -posterize 64 <IN_FILE>.tif <OUT_FILE>.tif
Resulting TIFF-file sRGB (low posterize color-level):
Code: Select all
convert +dither -posterize 8 <IN_FILE>.tif <OUT_FILE>.tif
Resulting TIFF-file sRGB (high posterize color-level):
Code: Select all
convert +dither -posterize 64 -depth 8 <IN_FILE>.tif <OUT_FILE>.tif
So for some reason color-depth will be changed from 8bit to 16bit for higher color-level values when trying to convert sRGB TIFF-files.
Option "-depth 8" unfortunately will be ignored.
Don't know for sure if described behavior of ImageMagick's convert for TIFF-files is intended, or if I possibly found a bug.
How can I workaround this problem?
LibTIFF's tiff2pdf can only handle 8bit TIFF-files!