• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Properly dealing with images
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Properly dealing with images


  • Subject: Re: Properly dealing with images
  • From: Marcel Weiher <email@hidden>
  • Date: Thu, 17 Jun 2004 12:57:30 +0100

On 17 Jun 2004, at 10:39, Michael Becker wrote:

I really don't know how to go about this one: My application basically works with and on images. So far, everything works. I simply use NSImages to display and manipulate the image data. However, here's my problem:

Hmmm..if your app primarily deals with images, you probably don't want to use NSImage.

NSImage doesn't seem to take into account that there are different image resolutions. I have a 1800 x 1800 pixel image at 20 pixels per inch. NSImage tells me that it's 6480 x 6480 pixels (which would be true if it was at the standard 72 pixels per inch).

NSImage does not know about pixels. It is giving you the -size, which is measured in (Postscript) points, which are 1/72 of an inch.

I need the *real* image dimensions

The -size method gives you the *real* dimensions, just not the number of pixels. The Postscript/PDF imaging model that Quartz uses is device independent, meaning measurements are in real units of length (points/inches/centimeters/lightyears), not in device-specific measures such as pixels.

(in this case that would be the 1800 x 1800) because I need to calculate a quality factor for each image. And that one only depends on the image size.
I am not familiar with TIFFRepresentations / BitmapRepresentations (actually Representations in general), would they do me any good here?

If you are dealing with bitmap images, use NSBitmapImageRep. Forget about NSImage. There, see -pixelsWide and -pixelsHigh.

Cheers,

Marcel
_______________________________________________
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.


References: 
 >Properly dealing with images (From: Michael Becker <email@hidden>)

  • Prev by Date: Re: Releasing memory
  • Next by Date: Re: Detail view beginner question
  • Previous by thread: Properly dealing with images
  • Next by thread: Re: Properly dealing with images
  • Index(es):
    • Date
    • Thread