I noticed that when placing PNG images in a view using IB and / or animating these images in different positions around the view, the image can sometimes blur slightly.
In most cases, I can fix the blur by adding 0.5 pixels to the image position.
[lbLiteButton.layer setPosition:CGPointMake(140.5,159.5)]
Sometimes I have to configure both x and y, as described above. Sometimes I only need to configure x or y.
I remember reading somewhere that this is due to the size of the image and how the main animation works and what to do with half the pixels ... but I canβt find the article anywhere !?
The problem with the ".5 pixels" solution is that it is different for each PNG image depending on the size, so you cannot reuse custom animations because you need to customize it for each image.
- Is there a way to guarantee that no matter where I place or animate my image, I will not get blurry positions?
- Does anyone have any info on this?
Thanks!
iphone core-animation png blur
Jonathan
source share