views:

162

answers:

2

The image on the right is the one that I produced in photoshop. I then stripped all text and put it in an image view, as soon as I did that there was a change in colour and the vertical line lost it sharpness. Has anyone else run into a similar problem? What do I do? alt text

+1  A: 

Are the dimensions correct? Is the position of the image an integer? If these cases antialiasing will slightly blur your image.

KennyTM
Yes, it looks like the most likely problem is that he's aligned the image view on a non-integer coordinate in X or Y, or that he's applied a transform of some sort to the view.
Brad Larson
Yes the dimensions are correct, and Yes the position is an integer. I have applied no transformation.
woody993
Try using the Core Animation instrument in Instruments, and selecting the Color Misaligned Images option. It should color any views or layers that are non-pixel-aligned in your application. Maybe a superview somewhere in the hierarchy isn't aligned properly.
Brad Larson
A: 

One thing to be careful of is that if your image is an odd number of pixels in either dimension then centering it onscreen will cause it to be misaligned. Imagine if you had a 1x1 image (just one pixel) and tried to center it perfectly onscreen. It can't be done because the screen is an even number of pixels wide and high. This is why it's best to always use even dimensioned images whenever possible.

n8gray