Re: TIFFs and Resolution
Re: TIFFs and Resolution
- Subject: Re: TIFFs and Resolution
- From: Ali Ozer <email@hidden>
- Date: Thu, 23 May 2002 08:48:44 -0700
I have a BitmapImageRep that I've set the width and height to increase the
resolution of the picture. When I get a TIFFRepresentation of the image and
write it to a file c/o NSData's writeToFile:atomically: I always seem to end
up with a 72 dpi TIFF. I have tried approaching this from a number of different
angles - getting the TIFF data from the NSImage from the NSImageRep, but it
doesn't seem to matter what I set height and width to..
Sounds like you're doing the right thing... The resolution of an NSBitmapImageRep is determined from its pixel count (pixelsWide x pixelsHigh) and its size (size, in points, which are approx 1/72 inch). Basically,
x resolution = pixelsWide * 72 / size.width.x;
y resolution = pixelsHigh * 72 / size.width.y;
If you set the pixel size and actual size, the resolution will be automatically written.
Note that for cached NSImages which only exist as window backing stores, the resolution will always have been reduced to 72 dpi.
Ali
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.