is there any way to disable antialiasing when scaling images in uiimage? thanks
Asked
Active
Viewed 4,838 times
19
-
9For google's sake, this is also called bitmap smoothing, anti aliasing, sampling, upsampling, downsampling, resampling, and making pixels sharp when scaling or a scale transform is applied. =) – Jeff Ward Feb 14 '12 at 22:58
2 Answers
37
Add the QuartzCore framework to your project, then set the image view’s layer
’s magnificationFilter
property to kCAFilterNearest
.

Noah Witherspoon
- 57,021
- 16
- 130
- 131
-
4For MonoTouch users this constant is available under: CALayer.FilterNearest – Jacob Foshee Jun 11 '12 at 15:20
3
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

Reitenator
- 1,075
- 13
- 13