NSImageInterpolationNone no longer works in Big Sur

As the developer of Seashore, using

Code Block
[[NSGraphicsContext currentContext] setImageInterpolation:NSImageInterpolationNone];

no longer works as expected in Big Sur on a Retina display. The exact build works fine in Catalina.

Small images seem to be first scaled using Medium or High interpolation to 2x, then scaled use 'None' to the desired size - causing blurriness.

This the code to display and scale the image:

Code Block
[[NSGraphicsContext currentContext] setImageInterpolation:NSImageInterpolationNone];
[image drawInRect:alignedRect fromRect:copy operation:NSCompositeSourceOver fraction:1.0 respectFlipped:TRUE hints:NULL];


Any ideas for a fix?

Did you find a solution? I'm hitting the same issue.

Found a fix:

CGContextSetInterpolationQuality(myBitmapContext, kCGInterpolationNone);

Turns out setImageInterpolation: gets ignored now, but CGContextSetInterpolationQuality() still works. My guess is that Apple changed the NS-level behavior because interpolation is so fast nowadays that it's no longer really a performance optimization, which seems to be how they were thinking of it. But the CG-level behavior gives you what you ask for.

NSImageInterpolationNone no longer works in Big Sur
 
 
Q