Page 1 of 1

Density (PPI) problems

Posted: 2010-07-08T15:38:04-07:00
by redna379
It's just that easy.
I do have a png input file (file.png), which is a 720 PPI one.
If i try these simple commands:

convert file.png file2.png
convert file.png -units PixelsPerInch -density 720 file2.png

By opening file2.png in Photoshop, it reports the resolution of the file is 719,988 pixels/inch.
Why does this happen?

The question is now posted in very simple terms, but the main reason is i'm working on a small tool to create interlaced files for lenticular printing, and to do so i'd need a very precise control against the resolution only, without resampling the image.
On the test i'm making, for example, i'd need to final file to be a 754.8 PPI. But step after step, the PPI i can see in photoshop is everytime more different than the value i set via the density option.

IM version i'm using is 6.6.3-Q16 on win7-64 (version: Portable Win32 static at 16 bits-per-pixel).

Any idea?

Re: Density (PPI) problems

Posted: 2010-07-08T16:37:58-07:00
by el_supremo
The problem is that the PNG format only allows the resolution to be specified in pixels per metre which when converted from ppi to ppm and back to ppi again has a problem with round-off error.
IM converts 720 pixels per inch to 720/.0254 = 28346ppm and stores this in the PNG. When Photoshop converts this back it gets 28346*.0254 = 719.9884ppi.

Pete

Re: Density (PPI) problems

Posted: 2010-07-09T02:25:17-07:00
by redna379
Interesting reply: i completely forgot the entire ppm issue.
Well, then i will try to go back to tiff, or some other format.

Thanks!