Rakka Rage
Rakka Rage

Reputation: 19449

UIImage ScaleToFit disable antialias?

antialiasing in UIImage scale to fit

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

Upvotes: 19

Views: 4944

Answers (2)

Reitenator
Reitenator

Reputation: 1135

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

Upvotes: 3

Noah Witherspoon
Noah Witherspoon

Reputation: 57149

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

Upvotes: 37

Related Questions