Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

How do you change the color palette for a 16-bit image? (LabVIEW)

I am trying to change the color palette used to display 16-bit images in Labview. The WinDisplay vi's help documentation notes that color palette clusters from IMAQ GetPalette will only work for 8-bit images; and indeed, wiring in a color palette has no effect on the display of the 16-bit image. I do not wish to use IMAQ TypeCast to convert the 16-bit image to 8-bits, because that vi drops the right most bits (like the "downshift" conversion policy. FYI: I am using the GivenRange converstion policy from IMAQ WindDisplayMapping to display my 16-bit images in greyscale.) I am currently resigned to applying some GivenRange type math to my 16-bit images in array form, converting the type of that array to U8 an
d then converting that U8 array to an 8-bit image. (I know this approach will also lose data, but I think this will just be a loss in resolution versus the dropping of rightmost bits. Correct?) I've also briefly looked at the lookup table functionality, which will be useful later, but doesn't help me display certain values as certain colors. Does anyone have any better suggestions?

Thanks in advance,
Max
0 Kudos
Message 1 of 3
(4,384 Views)
Max,

I have not had any problems using the color palette with 16 bit images. The conversion policy tells LabVIEW how to convert your image to 8 bits for display, and the palette tells it how to display the 8 bit image. The conversion is all internal, so you don't have to worry about it.

I have attached a quick demo that loads a 16 bit image and displays it using the selected conversion policy and color palette.

Bruce
Bruce Ammons
Ammons Engineering
Message 2 of 3
(4,384 Views)
Bruce,

Thanks. I'm not sure why I observed otherwise earlier,
but I rewired the color palette to the WinDraw displaying the 16-bit image and it worked fine.

Thanks again for clarifying,
Max
0 Kudos
Message 3 of 3
(4,384 Views)