From: Daniel H. <dh...@gm...> - 2011-10-13 15:07:22
|
> > > imshow() does take an "interpolation" kwarg, where you can specify > "nearest" for pre v1.1.0 versions and "none" (not None) in the recent > release. "nearest" would be close to what you want, while "none" is exactly > what you want. > > Personally, I don't think it would be a good idea to automatically turn > interpolation off on such a specific set of conditions, but I could be > wrong. I would rather have the user explicitly state their interpolation > intentions. > > Ben Root Hello Ben, Isn't the purpose of interpolation to handle situations where the image is being displayed at a different size than its native resolution? It seems appropriate to me to turn interpolation off in such a case. Just some context of what I was up to when I ran into this one....I'm trying to allow the user to paste images (either from file or clipboard) onto a matplotlib canvas and be able to drag and resize them, very similar to the way powerpoint works. So I wanted to work with the appropriate image object in matplotlib, and BboxImage was the best I found after digging in the code for a bit; imshow() is too tied to the axis....these are supposed to be just free floating images. What I ran into was that, on initial paste (where I am sizing the BboxImage the same width/height as the incoming picture), the image was very blurry (because of the interpolation). I still want the interpolation on so that the image looks nice when it is resized by the user with the grab handles, but in the specific case where no interpolation is needed, this patch turns it off. The pasting/dragging/resizing has actually turned out pretty well...once I get it cleaned up and working how I want it to, I'll submit it to you guys for inclusion into matplotlib if you want it. I was hoping to formulate it as a mixin that will work for any artist (not just BboxImage) within reasonable limits. -- Daniel Hyams dh...@gm... |