Reputation: 407
I need to generate such style image as this:
from matrix of numbers. Does anybody know any libs (preferable android/java) to doing it ?
Upvotes: 1
Views: 172
Reputation: 6404
Generating the image is pretty trivial - you map the data to integers in a given range, then use as index in a look-up table. If you have only a limited range, say 0-255, you can save as GIF, if the range is larger, as a 24 bit truecolour image.
The hard part is generating the palettes. I have some on my website (they're written in C but it's trivial to change them over to any other sane language). Thye show geographical height with snow-topped mountains for the high values, lush green for the valleys, and deep blue water for the depths. Another is a heat map going from cold blue to red hot.
Go to this link and take the files colourschemes.c and .h
http://www.malcolmmclean.site11.com/www/datadensity/DataDensity.html
Upvotes: 1