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

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
josch
Posts: 2
Joined: 2012-03-29T02:18:00-07:00
Authentication code: 8675308

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

Post 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)
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post by fmw42 »

I can confirm the same in IM 6.9.10.8 Q16 Mac OSX Sierra. Could be a bug.
muccigrosso
Posts: 64
Joined: 2017-10-03T10:39:52-07:00
Authentication code: 1151

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

Post 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
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

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

Post 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.
muccigrosso
Posts: 64
Joined: 2017-10-03T10:39:52-07:00
Authentication code: 1151

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

Post 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.
Post Reply