c# - 16bit greyscale image to heatmap -


i'm working on scientific imaging software university, , i've encountered major problem. scientific camera (apogee alta u57) @ lab provides images 16bpp array - it's 0-65535 values per pixel! want keep range, in fact can't display them on monitor (0-255 grayscale range). found way resolve problem - make use of colors, , display whole image heatmap (from black, blue, through green , red, pure white).

i mean - example heatmap image want achieve enter image description here

my question is: how efficiently convert 16bpp array of pixel values complete heatmap bitmap in c#? there libraries doing that? if not, how achieve using .net resources?

my idea create function maps 65536 values (255 r, 255g, 255b), it's tough job - without using hsv model.

i obliged provided!

your question consist of several parts:

  • reading in 16 bit pixel data values
  • mapping them 24 bit rgb colors
  • writing them out image file

i'll skip part 1 , 3 , give few ideas part 2.

it in fact harder seems. unique mapping doesn't lose information simple, in fact trivial, little bit shifting do.

but want result work visually, meaning not should visually appealing should make sense human eye. need mapping has credible yet large enough gradient.

for should experiment little. suggest make use of lineargradientbrush, show here. have @ interpolatecolors function! uses 6 colors in example, way few case!

you should pick many more; may need go through color space in spiral..

the trick choose both nice , enough stop colors create 64k large set of unique colors, best going blueish reddish..

you need test result uniqueness; in fact may want create pair of dictionary , dictionary mappings..


Comments

Popular posts from this blog

php - Zend Framework / Skeleton-Application / Composer install issue -

c# - Better 64-bit byte array hash -

python - PyCharm Type error Message -