Re: NSImageView bug?
Re: NSImageView bug?
- Subject: Re: NSImageView bug?
- From: Andy Armstrong <email@hidden>
- Date: Sat, 8 Oct 2005 23:52:57 +0100
On 8 Oct 2005, at 23:00, Dario Mèndez Musicò wrote:
I'm not sure I get that... do you have an example or something?
Thanks in advance.
Firstly I don't know the fix in your case - someone else will have to
comment on that...
But the basic reason why you see 'fuzzy' images is because they can
be drawn so that they are not precisely aligned on a physical pixel
boundary. When the pixels are aligned each pixel of the display takes
its colour from a single pixel in the image - and in that way you get
a sharp image. With sub-pixel alignment the image might be drawn
shifted, say, half a pixel relative to the display. In that case a
mathematical manipulation is performed on the image to produce an
approximation of what it should look like when shifted half a pixel.
That results in any sharply defined edges in the image (including the
edges /of/ the image) being blurred - because they are spread across
two adjacent pixels. Imagine a 2 x 1 grey scale image with pixel
values like this
-------------
| 0 | 255 |
-------------
If you paint that on the display device with the pixels aligned you
will get
-------------
| 0 | 255 |
-------------
v v v v v v
-------------
| 0 | 255 |
-------------
which is what you're expecting. If you shift it horizontally half a
pixel you'll get something like this:
-------------
| 0 | 255 |
-------------
v v v v v v
-------------------
| 0 | 128 | 128 |
-------------------
(and if you're reading this mail using a proportionally spaced font
you just got a jumble of characters that has probably confused you
even more)
See what happened there? Each pixel on the display derives its value
from (in this case) two pixels in the image. While this is
mathematically correct it turns your single white pixel into two
adjacent grey pixels.
Does that make any more sense?
--
Andy Armstrong, hexten.net
_______________________________________________
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