Re: Preview and "Respect Image DPI for Actual Size"
Re: Preview and "Respect Image DPI for Actual Size"
- Subject: Re: Preview and "Respect Image DPI for Actual Size"
- From: Heinrich Giesen <email@hidden>
- Date: Wed, 7 Dec 2005 12:43:55 +0100
On 07.12.2005, at 02:30, John Stiles wrote:
We would like these images to appear unscaled on the
user's monitor, since the scaling leaves jaggy artifacts which look
bad. To that end, we have been trying to set the image's DPI to match
the screen DPI.
This does not avoid scaling. Assuming the screen resolution is 72 dpi
the image is not scaled if [theRep size.width]==[theRep pixeldWide]
(same with height). If you see jaggies due to scaling then your imageRep
has not a resolution of 72 dpi. Check it out:
- (float) dpiX { return 72.0*[theRep pixelsWide]/[theRep size].width; }
- (float) dpiY { return 72.0*[theRep pixelsHigh]/[theRep
size].height; }
We also noticed that PNGs were reporting oddball sizes like "72.007
DPI" in Preview's Get Info panel. I don't know why that might be;
we're definitely passing "72 << 16" for our DPI size. JPEGs didn't
have this problem.
In PNG-images the resolution is measured in dots per meter, which leads
to "rounding errors": 72 dots per inch = 72/2.54 * 100 ) dots per meter
(= 2834.646 dots per meter).
Jpeg images can store the resolution (in a separate App0 marker) in
dots per inch or in dots per centimeter.
--
Heinrich Giesen
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden