LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

create color table from a jpeg

Solved!
Go to solution

OK, here's the (seemingly?) correct way to read LUT files into a 256 element color map (LabVIEW 2014).

 

See if it works for you. 😄

 

 

Download All
0 Kudos
Message 11 of 13
(2,360 Views)

Hi Christian,

 

thanks for correcting me.

 

It was a (kind of) copy&paste error: I looked at those LUT files using a hex editor presenting byte offsets in hexadecimal. Ofcourse you need to use 0x100=0d256 instead of 0d100 when reshaping the array.

 

Background: Several years ago I worked with an ultrasonic microscope. The software for that scope used similar (or even the same) color files for generating images - back then I also used my own LabVIEW routine to convert measurement results to nice(r) images and also had to load such LUT files. Back then those files also had a filesize of 768 bytes (768 = 3*256 = 256 * RGB), so all you have to do when loading them is to recognize the order the bytes are written in such files (either "RGB, RGB, RGB…" or "RRR…, GGG…, BBB…").

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 12 of 13
(2,326 Views)

In summary:

 

  • The *.lut files sometimes have a variable size header that I did no investigate further. (e.g. some are 800bytes)
  • We need to get the last 768 bytes from the file and discard the beginning if the file ls longer than that.
  • The color arrangement is not [RGBRGBRGB...RGBRGBRGB] but [RRR....RRRGGG...GGGBBB...BBBB], each stretch is 256 bytes.

 

In any case, this website has a nice collection of color tables and I might actually use some of those. Great find. Thanks!

0 Kudos
Message 13 of 13
(2,315 Views)