← Back

ofxColorMap

github.com/luteberget/ofxColorMap · @luteberget
OF 0.9 Graphics

Convert scalar data (grayscale images) to pseudo-color images with linear segmented color maps.

24 5 Last commit 9y ago Created 12y ago

Forks

Forks pushed to more recently than luteberget/ofxColorMap itself, plus any admin-confirmed fork with commits of its own — worth checking if you're hitting issues with the original.

ConduiteAlgorithmique/ofxColorMap by @ConduiteAlgorithmique · ★ 0 · pushed 7y ago

README

ofxColorMap



Colorize your grayscale images with a linear segmented color map, as used in scientific plotting. Maps are taken from Matplotlib.

Usage

Add an ofxColorMap object to your app. Select a colormap Use a preset colormap. See list of preset maps below.
      colormap.setMapFromName("summer")
      


Alternatively, make your own color map. See matplotlib documentation for an explanation of the parameters.
      ofxColorMap::ColorMapChannel r ; r .push_back(ofVec3f( 0.0,0.0,0.0 )); r .push_back(ofVec3f( 1.0,1.0,1.0 ));
      ofxColorMap::ColorMapChannel g ; g .push_back(ofVec3f( 0.0,0.5,0.5 )); g .push_back(ofVec3f( 1.0,1.0,1.0 ));
      ofxColorMap::ColorMapChannel b ; b .push_back(ofVec3f( 0.0,0.4,0.4 )); b .push_back(ofVec3f( 1.0,0.4,0.4 ));
      ofxColorMap::ColorMap m; m.push_back(r); m.push_back(g); m.push_back(b);
      colormap.set(m);
      
   colormap.apply(inputImage, outputImage);
   


Examples/screenshots



Available maps (from Matplotlib).



See: http://matplotlib.org/examples/color/colormaps_reference.html

Get this addon

HTTPS
SSH