Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't interpolate images in RGB space #5490

Closed
mdboom opened this issue Nov 16, 2015 · 8 comments · Fixed by #5718
Closed

Don't interpolate images in RGB space #5490

mdboom opened this issue Nov 16, 2015 · 8 comments · Fixed by #5718
Assignees
Milestone

Comments

@mdboom
Copy link
Member

mdboom commented Nov 16, 2015

We currently interpolate images by mapping the raw data into RGB, then interpolate that RGB (using any number of algorithms) to produce the final result. This can result in colors that don't actually appear in the colormap to be in the final result.

interpolation_methods

We should instead change the order of operations so that the interpolation happens on the raw data (in floating-point space), then the image is color mapped.

@mdboom mdboom added this to the proposed next point release (2.1) milestone Nov 16, 2015
@mdboom
Copy link
Member Author

mdboom commented Dec 2, 2015

I think I have the Agg part of this figured out. See http://github.com/mdboom/aggravate

All that's left, then, is the Python side of things, and #5602 offers some guidance as to where to insert the floating-point interpolation operations. Ideally, the matplotlib._image.Image class on the C++ side should go away. It predates Numpy when we needed a class just to store the image data. Now, a Numpy array will do, and it would be better to just have functions on the C++ side for interpolation and coloring.

@WeatherGod
Copy link
Member

"aggravate"? You get a free beer from me at the next SciPy meeting!

On Wed, Dec 2, 2015 at 1:38 PM, Michael Droettboom <notifications@github.com

wrote:

I think I have the Agg part of this figured out. See mdboom/aggravate

All that's left, then, is the Python side of things, and #5602
#5602 offers some guidance
as to where to insert the floating-point interpolation operations. Ideally,
the matplotlib._image.Image class on the C++ side should go away. It
predates Numpy when we needed a class just to store the image data. Now, a
Numpy array will do, and it would be better to just have functions on the
C++ side for interpolation and coloring.


Reply to this email directly or view it on GitHub
#5490 (comment)
.

@mdboom
Copy link
Member Author

mdboom commented Dec 2, 2015

Roget's says it's a synonym for "magnify".

@WeatherGod
Copy link
Member

Yes, it works on so many levels. #wordsmith

On Wed, Dec 2, 2015 at 1:43 PM, Michael Droettboom <notifications@github.com

wrote:

Roget's says it's a synonym for "magnify".


Reply to this email directly or view it on GitHub
#5490 (comment)
.

@tacaswell
Copy link
Member

shiny!

@mdboom
Copy link
Member Author

mdboom commented Dec 3, 2015

One advantage of rewriting the image interpolation as a purely functional interface is that it was really easy to add OpenMP support to take advantage of multiple cores.

@tacaswell
Copy link
Member

It is not obviously to me which of those interplotaions is 'average all of the values that fall under this much larger pixel' (ex, coarse graining).

@mdboom
Copy link
Member Author

mdboom commented Dec 3, 2015

It is not obviously to me which of those interplotaions is 'average all of the values that fall under this much larger pixel' (ex, coarse graining).

The different filter kernels are essentially amount to weighted averages with different curves.

@mdboom mdboom self-assigned this Dec 22, 2015
@tacaswell tacaswell assigned tacaswell and unassigned mdboom Feb 8, 2016
@QuLogic QuLogic modified the milestones: 2.0 (style change major release), 2.1 (next point release) Feb 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants