is there any way to disable antialiasing when scaling images in uiimage? thanks
Asked
Active
Viewed 4,665 times
18
-
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
36
Add the QuartzCore framework to your project, then set the image view’s layer’s magnificationFilter property to kCAFilterNearest.
Noah Witherspoon
- 56,657
- 16
- 129
- 131
-
4For MonoTouch users this constant is available under: CALayer.FilterNearest – Jacob Foshee Jun 11 '12 at 15:20
2
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
- 905
- 9
- 11