enable icon indicating copy to clipboard operation
enable copied to clipboard

Unable to disable interpolation with agg backend

Open drbsg opened this issue 3 years ago • 5 comments

I am trying to render an image to an array with antialiasing and interpolation turned off using the agg backend. From some experimentation and going through the code, it appears that turning off interpolation is not an option. This differs from e.g. matplotlib which also uses agg and allows it to be turned off.

Is this something that could be easily implemented?

drbsg avatar Jun 30 '22 09:06 drbsg

Try calling gc.set_antialias(False) before rendering the image?

corranwebster avatar Jun 30 '22 11:06 corranwebster

I did that, but there is still evidence of antialiasing happening, just not to the same extent. So I tried turning off interpolation as well, but there is no option to do so.

drbsg avatar Jun 30 '22 12:06 drbsg

I think gc.set_image_interpolation("nearest") might be what you want to use to control interpolation. If you're still getting antialiasing after that, I'm not sure what else to tweak.

corranwebster avatar Jun 30 '22 12:06 corranwebster

One other thought - if this is in a Component you may need to make sure that backbuffering is turned off.

corranwebster avatar Jun 30 '22 12:06 corranwebster

Adjusting all these settings has not solved the problem - I still get some antialiasing or interpolation. I am now trying to use the celiagg backend which doesn't support interpolation.

drbsg avatar Jun 30 '22 14:06 drbsg