Page 1 of 1

ppi get rounded

Posted: 2015-09-28T22:56:10-07:00
by Lars-Daniel
Hi there,

I've got a TIFF file coming from Photoshop CC 2015. It has 3991 x 3991 px. Since it should be printed at 550 x 550 mm, Photoshop has the ppi to 184.30 in EXIF. I'm using this to convert the TIFF to PDF with JPEG-compression:

Code: Select all

convert2 -strip -interlace Plane -define jpeg:dct-method=float -quality 85 source.tif result.tif
After this, the JPEG's ppi got set to 184 ... seems like some rounding is done. Is this a bug?
My version installed: ImageMagick 6.9.1-3 Q16 i686 2015-07-01 http://www.imagemagick.org

Is there a work-around always to auto-set the ppi (no resizing etc.) to make it fit to 550 x 500 mm ?

Best,
Lars-Daniel

Re: ppi get rounded

Posted: 2015-09-28T23:12:06-07:00
by fmw42
How are you determining the IM density? If using identify -verbose, perhaps that is just an IM readout that is truncated, but the image may have the proper density. Try using EXIFTOOL to see the actual density.

Also what platform are you on?

If you post your image to dropbox.com and put the URL here, some one can verify the proper density.

Re: ppi get rounded

Posted: 2015-09-28T23:21:27-07:00
by Lars-Daniel
fmw42 wrote:How are you determining the IM density? If using identify -verbose, perhaps that is just an IM readout that is truncated, but the image may have the proper density. Try using EXIFTOOL to see the actual density..
identify tells me for the source:
Geometry: 3991x3991+0+0
Resolution: 184.302x184.302
Print size: 21.6547x21.6547
EXIFTOOL, Photoshop, IrfanView and identify tell me for the result:
Geometry: 3991x3991+0+0
Resolution: 184x184
Print size: 21.6902x21.6902
fmw42 wrote:Also what platform are you on?
Windows, but it 's the cygwin build. On my Debian Jessie, I'm getting the same results.
fmw42 wrote:If you post your image to dropbox.com and put the URL here, some one can verify the proper density.
I can't. It's a HQ scan of fine art. An artist draw it some weeks ago and it's fully protected by copyright. Maybe I can do the same with an empty image. Let me test.

Re: ppi get rounded

Posted: 2015-09-28T23:26:08-07:00
by Lars-Daniel
Yeah, seems to be a bug! I can reproduce it with a small test file: http://ge.tt/api/1/files/6vkw3vO2/0/blob?download

Code: Select all

convert -strip -interlace Plane -define jpeg:dct-method=float -quality 85 test.tif result.jpg
source:
Geometry: 800x800+0+0
Resolution: 36.945x36.945
Print size: 21.6538x21.6538
Units: PixelsPerInch
result:
Geometry: 800x800+0+0
Resolution: 37x37
Print size: 21.6216x21.6216
Units: PixelsPerInch

Re: ppi get rounded

Posted: 2015-09-29T00:02:03-07:00
by snibgo
TIFF works fine for me:

Code: Select all

f:\web\im>%IM%convert rose: -density 123.456 -units PixelsPerInch r.tiff

f:\web\im>%IM%convert r.tiff -strip r2.tiff

f:\web\im>%IM%identify -verbose r2.tiff | grep Resolution
  Resolution: 123.456x123.456
But JPG is integer only:

Code: Select all

f:\web\im>%IM%convert rose: -density 123.456 -units PixelsPerInch r.jpg

f:\web\im>%IM%identify -verbose r.jpg | grep Resolution
  Resolution: 123x123
I don't know if this is an IM bug, or a limitation of JPG.

Re: ppi get rounded

Posted: 2015-09-29T00:31:18-07:00
by Lars-Daniel
snibgo wrote:I don't know if this is an IM bug, or a limitation of JPG.
JFIF APP0 marker segment has 2 bytes for Xdensity/Ydensity density - is this important ?

Re: ppi get rounded

Posted: 2015-09-29T00:37:31-07:00
by Lars-Daniel
I've created a JPEG in Photoshop with resolution 12.3 x 12.3. Identify does recognize this correctly. But I think, EXIF is used to store the correct size.
Edit: EXIF with XResolution/YResolution is needed to make float work...

Re: ppi get rounded

Posted: 2015-09-29T05:20:52-07:00
by magick
We can reproduce the problem you posted and have a patch in ImageMagick 6.9.2-4 Beta, available by sometime tomorrow. Thanks.

Re: ppi get rounded

Posted: 2016-08-24T16:34:43-07:00
by Lars-Daniel
magick wrote:We can reproduce the problem you posted and have a patch in ImageMagick 6.9.2-4 Beta, available by sometime tomorrow. Thanks.
ImageMagick v7.0.2-9 Q16 x64 2016-08-14 still has this problem :(

Re: ppi get rounded

Posted: 2016-11-01T08:29:29-07:00
by Lars-Daniel
This bug still has NOT been fixed.

Re: ppi get rounded

Posted: 2016-11-02T14:17:22-07:00
by fmw42
Lars-Daniel wrote:This bug still has NOT been fixed.
In what version of IM? If not fixed in the most current version, then you should report this on the Bugs forum.