Group 4 compression and pixel aspect ratio

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
aporthog
Posts: 37
Joined: 2012-05-30T08:24:46-07:00
Authentication code: 13

Group 4 compression and pixel aspect ratio

Post by aporthog » 2013-02-26T05:53:29-07:00

Our photographer is complaining that whenever he tries and opens my IM tiffs in Photoshop it pops up a warning about pixel aspect ratio correction. I hadn't noticed this before because I don't use Photoshop. So I did some experimenting with my command lines and found the last step -compress Group4 is the culprit, no other compression formats I've tried make Photoshop emit this warning. Looking at the tiff header I see this:

Code: Select all

<tiff:XResolution>100/1</tiff:XResolution>
<tiff:YResolution>150/1</tiff:YResolution>
I hate to ask this question because I've seen a lot of posts here on this same subject but I can't figure any of the answers out or apply them to my book page images. Because I use -trim the output size of each page image, the output size is a little different for each image so I need a solution that I can apply across all images or be able to calculate programmatically for each image.

Here is my command line for a sample image:

Code: Select all

convert underneath_243_L.CR2 -crop 5330x3145+300+250 +repage -rotate 270 -bordercolor black -border 1x1 -fuzz 90% -trim -crop -180+0 +repage -resize 150% -level 18% -sharpen 0x3.5 -normalize +contrast -background black -deskew 40% +repage -threshold 40% -depth 1 -bordercolor black -border 1 -fuzz 95% -fill white -draw "color 0,0 floodfill" -alpha off -shave 1x1 -compress Group4 underneath_243_L.tif
Removing the -compress option or changing it to LZW doesn't cause the warning.

I've experimented with using -density in various places, including after the -compress but it doesn't seem to make a difference.

My sample image can be found here:

http://ucblibrary4.berkeley.edu/~apollock/imagemagick

aporthog
Posts: 37
Joined: 2012-05-30T08:24:46-07:00
Authentication code: 13

Re: Group 4 compression and pixel aspect ratio

Post by aporthog » 2013-02-26T08:00:48-07:00

I did a few more tests. I also took a tiff I had saved in Photoshop as LZW compressed and did a few manipulations and saved as Group4 in ImageMagick but this time I did not get the Photoshop warning about pixel aspect ratio. So far it happens only when I start with the original camera raw format. I also forgot to mention I tried using -strip to remove the tiff header information but it didn't seem to work, i.e., the info was still there. I then removed it using a different program and also tried editing the X and YResolution fields using EXIFTool but in both cases I still got the Photoshop warning.

Post Reply