Colormaps for visualizing greyscale images in Torch. All styles in MATLAB (parula, jet, hsv, autumn, and everything else here) are supported.
$ luarocks install colormap
Requires Torch7, luafilesystem, and image.
-
Choose the style and number of unique colors in the map with something like:
> require 'colormap'
> colormap:setStyle('parula')
> colormap:setSteps(512)
-
Pass in a single-channel image
> img = image.load('david.jpg')
> rgbImg = colormap:convert(img)
-
If you want a colorbar to go along with it:
> bar = colormap:colorbar(height, width)
Greyscale and colored David
Running > colormap:samples()
will generate images of a butterfly visualized with a few different styles and step numbers: