[Matplotlib-devel] [rfc] a better interchange format for colormaps

kthyng kthyng at gmail.com
Fri Apr 22 10:30:49 EDT 2016


Columns of rgb points that I have been using for sharing colormaps have
been pretty easy and straight-forward (easily extended to 4 columns for
alpha). Is the main problem the lack of meta data?

Kristen

On Thu, Apr 21, 2016 at 2:24 PM, Chris Barker - NOAA Federal [via
matplotlib] <ml-node+s1069221n46987h22 at n5.nabble.com> wrote:

> Great idea!
>
> AS it happens, we're messing with colormaps ourselves here, and indeed to
> need to have consistent ones across browser-JS and python -- so great
> timing!
>
> I'm not so sure about the encoding of the colors -- I read the
> justification (nicely written), but I still think file size is pretty much
> a non-issue -- these are not going to be gigabytes no matter how you slice
> it. and the compressed file sizes are definitely close enough in size to
> make no difference. So I would much prefer:
>
> [ [r, g, b], [r,g,b], ....]
>
> However, maybe that's because I still can't wrap my head easily around hex
> :-)
>
> I think compatibility with D3 per se should be a minor influence, but if
> Javascript itself "likes" to use hex colors and could more easily deal with
> this, then I guess that might be a driver (or do I think that because I'm a
> pythonista that could easily write the conversion code in Python than JS
> ...)
>
> Also for discrete colormaps, might there be a use case for transparency?
> i.e. RGBA ? In which case, the encoding should be able to handle  either
> three or four channels per color with no ambiguity. Would that be two hex
> values per color for a 32 bit color (then you have to have a clean
> endianness, yes?) or commas or something separating the colors.
>
> As for specifying the number of colors somewhere else, I agree that that's
> just a recipe for inconsistency with no gain -- is anyone going to have to
> write a parser where they have to alocate teh memory ahead of time???
>
> -CHB
>
>
> On Wed, Apr 20, 2016 at 4:22 PM, Nathaniel Smith <[hidden email]
> <http:///user/SendEmail.jtp?type=node&node=46987&i=0>> wrote:
>
>> Hi matplotters,
>>
>> We've been working on improving our tool for building custom
>> viridis-like colormaps (e.g. adding support for diverging colormaps),
>> and one of the things that we got frustrated by is how there's no
>> compelling way to save and distribute the resulting colormaps so that
>> people can actually use them. So, I wrote up a little spec to
>> standardize a way of storing and distributing colormaps in JSON, with
>> the hope that we can convince everyone to implement this and stop
>> writing silly little conversion scripts all the time.
>>
>> The v0.1 draft is here:
>>     https://github.com/njsmith/json-cm/blob/master/json-cm-spec.md
>>
>> Any comments? There are always a lot of fiddly details to get right in
>> this kind of thing -- I made a bunch of guesses about what kind of
>> stuff is important and how to represent it, but it can only benefit
>> from review from different perspectives. I would equally love to get
>> nitpicky critiques and high-level queries.
>>
>> Thanks!
>> -n
>>
>> --
>> Nathaniel J. Smith -- https://vorpus.org
>> _______________________________________________
>> Matplotlib-devel mailing list
>> [hidden email] <http:///user/SendEmail.jtp?type=node&node=46987&i=1>
>> https://mail.python.org/mailman/listinfo/matplotlib-devel
>>
>
>
>
> --
>
> Christopher Barker, Ph.D.
> Oceanographer
>
> Emergency Response Division
> NOAA/NOS/OR&R            (206) 526-6959   voice
> 7600 Sand Point Way NE   (206) 526-6329   fax
> Seattle, WA  98115       (206) 526-6317   main reception
>
> [hidden email] <http:///user/SendEmail.jtp?type=node&node=46987&i=2>
>
> _______________________________________________
> Matplotlib-devel mailing list
> [hidden email] <http:///user/SendEmail.jtp?type=node&node=46987&i=3>
> https://mail.python.org/mailman/listinfo/matplotlib-devel
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://matplotlib.1069221.n5.nabble.com/Matplotlib-devel-rfc-a-better-interchange-format-for-colormaps-tp46977p46987.html
> To start a new topic under matplotlib - devel, email
> ml-node+s1069221n28077h12 at n5.nabble.com
> To unsubscribe from matplotlib - devel, click here
> <http://matplotlib.1069221.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=28077&code=a3RoeW5nQGdtYWlsLmNvbXwyODA3N3wtMTk2MDcwNTI1Ng==>
> .
> NAML
> <http://matplotlib.1069221.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>



-- 
Kristen M. Thyng
Assistant Research Scientist
Department of Oceanography
Texas A&M University
Eller O&M 607
http://kristenthyng.com




--
View this message in context: http://matplotlib.1069221.n5.nabble.com/Matplotlib-devel-rfc-a-better-interchange-format-for-colormaps-tp46977p46992.html
Sent from the matplotlib - devel mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-devel/attachments/20160422/1b94d2b3/attachment-0001.html>


More information about the Matplotlib-devel mailing list