128 x 128 NSImage looks bad in a 32 x 32 NSImageView

30 Views Asked by At

I'm trying to present this example image inside a NSImageView: enter image description here

The image size is 128x128 and the NSImageView is 32x32.

I've created a new macOS project and placed that image inside NSImageView. The default settings gave me the blurry image below. I've also tried many scaling options such as scaleNone, scaleProportionallyUpOrDown, scaleProportionallyDown but the result still looks blurry:

enter image description here

Changing the NSImage size to 32x32 will fix the problem but I'm looking for the cause of this scaling issue. Creating a new project in Xcode for iOS with UIImageView & UIImage with the same sizes will display the image correctly. (I'm aware that there's a world of difference but I wanted to make sure that the image isn't the problem)

enter image description here

What am I missing?

0

There are 0 best solutions below