PDL::Transform::Color now has support for pseudocolor mapping, and a basic 
suite of named color tables.  They are accessible via the “t_pc” 
(“pseudocolor”) and “t_pcp” (pseudocolor, perceptual) transforms.  

The difference between t_pc and t_pcp is how luminance is treated.  t_pc is for 
handling of photometric or pseudo-photometric data (e.g. brightness values from 
a scientific digital camera, gamma=1).  t_pcp is for handling of perceptual 
data (typically encoded with gamma=2.2).  Both transforms use the same color 
tables — the tables that use primarily non-luminance qualities (saturation or 
hue) act exactly the same for either transform.

I’ve also modified PDL::Graphics::Gnuplot to support using the 
PDL::Transform::Color pseudocolors.  This is implemented using the plot options 
“pseudocolor” (or its abbrev “pc”) and “perceptual” (or its abbrev “pcp”).  
This should prevent having to square-root scale photometric data before 
plotting it — a solution that is lame at best since sRGB encoding is more 
complicated than that, but also practically universal at present.

The new builds are available for testing at
 https://www.github.com/drzowie/pdl-graphics-gnuplot
 https://www.github.com/drzowie/pdl-transform-color

You can, for example, compare the output from:

        $w=gpwin(wxt,size=>[12,4],{j=>1});
        $w->multiplot(layout=>[3,1]);
        $w->image(rvals(50,50),{clut=>’sepia’}); # built-in
        $w->image(rvals(50,50),{pcp=>’sepia’});  # perceptual 
        $w->image(rvals(50,50),{pc=>’sepia’});   # photometric

You can get a list of available PDL::Transform::Color palettes by feeding the 
empty string into the ‘pc’ or ‘pcp’ plot options in 
PDL::Graphics::Gnuplot::plot(), or by calling t_pc or t_pcp with no options in 
PDL::Transform::Color.

I’m open to suggestions for favorite color tables people would like to see 
added.

Cheers,
Craig


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
pdl-devel mailing list
pdl-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pdl-devel

Reply via email to