Non-perceptual colormaps equalisation tool
mycarta opened this issue · 2 comments
Is there any interest in adding somewhere in MPL a tool to equalize poor colormaps?
I've been working on a prototype replicating Peter Kovesi's Matlab function:
https://github.com/mycarta/rainbowbot/blob/master/equalize_colormap_test.ipynb
My idea is actually a full automatic 'rainbowbot':
https://github.com/mycarta/rainbowbot
https://github.com/mycarta/rainbowbot/blob/master/color_reduction_and_perceptual_test.ipynb
Regarding a tool to "fix" poor colormaps to matplotlib: You should probably ask on the matplotlib mailing list -- very few people will see a post here, and fewer matplotlib developers :-)
You should also get in touch with @kthyng specifically -- she's been thinking about similar things (e.g. see matplotlib/matplotlib#4681)
Regarding techniques for "fixing" poor colormaps: In the viridis talk, we wanted to give a simple example of how our tools for working with CAM02-UCS let you do awesome things in just a few lines of code. In the final version, we ended up using the circular colormap example for this -- but in the first draft our example was taking jet and smoothing it out to be more perceptually uniform :-). We used a simple approach of keeping exactly the same colors, but stretching and shrinking the mapping between data values and colors in order to make it perceptually uniform in the sense that equal sized steps in the data led to equal sized steps in CAM02-UCS space. It... didn't work terribly well, which is why we didn't use it in the talk :-). (The rescaled jet is better, but still pretty terrible -- probably because we hadn't read the Kovesi paper and so weren't putting any special emphasis on the lightness channel, and also because when you're starting with jet then there's only so much you can do.) But in case you want to play with it, the code is here.
Regarding the rainbowbot: @Carreau has also been playing around with the idea of a twitter bot to fix people's images; maybe you should consider joining forces :-)
Thanks Nathaniel
Great story, and thanks for sharing the code. It sounds like you guys were
on similar lines of thinking as when I was trying this:
https://github.com/mycarta/rainbowbot/blob/master/stuff4equalize_notebook/Equalize_Jet_Matlab.png
I've shown my ideas to @kthyng a couple of months ago, we've been i n
touch since her talk at Scipy. And I've also connected with @Carreau
through a scikit-image thread.
Cheers
Matteo
On Thu, January 28, 2016 8:14 pm, Nathaniel J. Smith wrote:
Regarding a tool to "fix" poor colormaps to matplotlib: You should
probably ask on the matplotlib mailing list -- very few people will see a
post here, and fewer matplotlib developers :-)You should also get in touch with @kthyng specifically -- she's been
thinking about similar things (e.g. see matplotlib/matplotlib#4681)Regarding techniques for "fixing" poor colormaps: In the viridis talk, we
wanted to give a simple example of how our tools for working with
CAM02-UCS let you do awesome things in just a few lines of code. In the
final version, we ended up using the circular colormap example for this
-- but in the first draft our example was taking jet and smoothing it out
to be more perceptually uniform :-). We used a simple approach of keeping
exactly the same colors, but stretching and shrinking the mapping between
data values and colors in order to make it perceptually uniform in the
sense that equal sized steps in the data led to equal sized steps in
CAM02-UCS space. It... didn't work terribly well, which is why we didn't
use it in the talk :-). (The rescaled jet is better, but still pretty
terrible -- probably because we hadn't read the Kovesi paper and so
weren't putting any special emphasis on the lightness channel, and also
because when you're starting with jet then there's only so mu ch you c an
do.) But in case you want to play with it, the code is
here.Regarding the rainbowbot: @Carreau has also been playing around with the
idea of a twitter bot to fix people's images; maybe you should consider
joining forces :-)
Reply to this email directly or view it on GitHub:
#7 (comment)