Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIImage ScaleToFit disable antialias?

antialiasing in UIImage scale to fit

is there any way to disable antialiasing when scaling images in uiimage? thanks

like image 622
Rakka Rage Avatar asked May 23 '11 02:05

Rakka Rage


2 Answers

Add the QuartzCore framework to your project, then set the image view’s layer’s magnificationFilter property to kCAFilterNearest.

like image 72
Noah Witherspoon Avatar answered Oct 21 '22 16:10

Noah Witherspoon


I was working with SpriteKit in Xcode 11 (Swift 5) and also got this problem. To solve it (i.e. disable anti-aliasing) i did the following:

texture?.filteringMode = SKTextureFilteringMode.nearest
like image 28
Reitenator Avatar answered Oct 21 '22 17:10

Reitenator