• 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: Anti-alias an NSIamgeView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Anti-alias an NSIamgeView


  • Subject: Re: Anti-alias an NSIamgeView
  • From: Dennis De Mars <email@hidden>
  • Date: Sun, 24 Nov 2002 19:30:59 -0800

On Sunday, November 24, 2002, at 06:26 PM, Ben Mackin wrote:

On 11/24/02 6:12 PM, "Dennis De Mars" <email@hidden> wrote:

Anti-aliasing is the process of preventing "aliasing" artifacts when a
signal is sampled. For an image, this means that if you have an image
at a high resolution, you pass it through an anti-alias filter before
sampling down to a lower resolution.

Before, I was displaying my images at 72 DPI (by accident they should have
been 209) and I could see that it was "blurring" the image, and it looked
pretty bad. I hope that isn't the best Quartz can do...

For geometric shapes (lines, bezier curves) and fonts which are defined
in terms of bezier curves, the resolution of the image before rendering
is effectively infinite. The standard way to apply anti-aliasing is to
render these objects at a high resolution (that is, at some multiple of
the pixels you actually need) and then apply an anti-aliasing filter
when downsampling to the actual resolution desired. That is what Quartz
does when you draw shapes and character strings into a view.

For predefined bitmap images, there is nothing Quartz can do if the
image is already at the size needed. If the predefined image is larger
than what you require, Quartz will apply anti-aliasing while scaling
down the image to the size requested. For instance, all of those images
you see in the dock are derived from a large icon which is scaled down
and looks smooth at any size, but to do this Quartz needs a large image
to begin with. If not, the results do not look good.

I guess I should have been a little clearer. The image is filled with text
(it is a received fax). So the image received is a TIFF file at 209 DPI,
filled with text (and some "true" images).

What I am shooting for is the look of Preview. If I open my tiff file in
Preview it anti-aliases it (if I turn off anti-aliasing in Preview it
degrades the quality so I know something is happening). So there has got to
be some way of keeping my DPI, and getting the anti-aliasing to work,
because thats what preview seems to be able to do.

OK, now that I have the details I agree you should be seeing better results. I had gotten the impression from your previous message that you were trying to view the image at the same resolution that it was saved at. If you have a 209 DPI image and display it at 72 DPI (which is the equivalent of scaling it down in terms of pixels) I would expect NSImage to produce results similar to what you see in Preview.

BTW, just for the record, the fact that the fax contains text is not in itself relevant because the fax is transmitted as a bitmap (that is, any text is rendered into a pixel representation even if the fax was sent directly from an word processor). By the time you receive it the whole fax is an image as far as the computer is concerned. But that is a side issue, if your received image is at a higher DPI than your displayed image then you should be seeing the benefits of anti-aliasing.

Maybe you could share the details of the Cocoa commands you are using to accomplish this. Are you doing something like:

NSImageView* imageView; // assume this is already created

NSImage* tiffImage = [[NSImage alloc] initWithContentsOfFile:@"myImage.tiff"];

[imageView setImage:tiffImage];

If it's something like that, I would expect it to work...

- Dennis D.
_______________________________________________
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: 
 >Re: Anti-alias an NSIamgeView (From: Ben Mackin <email@hidden>)

  • Prev by Date: Re: Ok...
  • Next by Date: (no subject)
  • Previous by thread: Re: Anti-alias an NSIamgeView
  • Next by thread: drawPageBorderWithSize question
  • Index(es):
    • Date
    • Thread