Page 1 of 1

How to create a group4 compressed tiff with tiff:photometric: min-is-black?

Posted: 2018-08-19T03:23:28-07:00
by josch
Hi,

I'm trying to create a TIFF file containing CCITT Group4 encoded monochrome data with a photometric interpretation of min-is-black.

I tried running the following:

Code: Select all

$ convert logo: -define quantum:polarity=min-is-black -compress Group4 out1.tif
$ convert logo: -compress Group4 -define quantum:polarity=min-is-black out2.tif
But both varieties give me a TIFF file with min-is-white:

Code: Select all

$ identify -verbose out1.tif | grep tiff:photometric:
    tiff:photometric: min-is-white
$ identify -verbose out2.tif | grep tiff:photometric:
    tiff:photometric: min-is-white
How do I produce a Group4 compressed TIFF image with tiff:photometric: min-is-black?

my version: ImageMagick 6.9.10-8 Q16 x86_64 20180723 (the one packaged in Debian unstable)

Re: How to create a group4 compressed tiff with tiff:photometric: min-is-black?

Posted: 2018-08-19T09:47:56-07:00
by fmw42
I can confirm the same in IM 6.9.10.8 Q16 Mac OSX Sierra. Could be a bug.

Re: How to create a group4 compressed tiff with tiff:photometric: min-is-black?

Posted: 2018-08-19T11:40:18-07:00
by muccigrosso
Ditto using magick in place of convert on my Mac with

Version: ImageMagick 7.0.8-10 Q16 x86_64 2018-08-18 https://www.imagemagick.org

Re: How to create a group4 compressed tiff with tiff:photometric: min-is-black?

Posted: 2018-08-19T14:37:09-07:00
by magick
Thanks for the problem report. We can reproduce it and will have a patch to fix it in GIT master branch @ https://github.com/ImageMagick/ImageMagick later today. The patch will be available in the beta releases of ImageMagick @ https://www.imagemagick.org/download/beta/ by sometime tomorrow.

Re: How to create a group4 compressed tiff with tiff:photometric: min-is-black?

Posted: 2018-09-02T22:22:47-07:00
by muccigrosso
Is there a broader problem with tiff compression? I'm having trouble getting group4 and fax (which I don't normally use) to give me good compression and these are the two compression schemes that were affected by this patch. For example,

Code: Select all

magick logo: -threshold 80% -alpha off -monochrome -compress METHOD -quality 100 output.tiff
gives me a 10k file when I use LZW as the method, but 39k for both fax and group4, and some larger files I'm using aren't showing good compression with group4 and those other parameters. That's putting it mildly: starting form pbm files I get no compression at all with group4 and fax.

On a Mac, ImageMagick 7.0.8-11 Q16 x86_64 2018-09-01, --with-fftw --with-x11 --with-openjpeg.