LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Greyscale Intensity Graph into JPG Fails.

Solved!
Go to solution

Hello,

 

I am attempting to save an unsigned 8-bit intensity graph into a jpg. The data comes from an IDS uEye camera, and displays well, but a) will not write to jpg/png, b) writes distorted bmp (looks like data loss/compression). The error output is code #1 from the Check Color Table Size.vi. As you can see, I do not have a color table wired into flatten pixmap-- is that my problem? If so, what do I input? I cannot find any information to clear this up. It's a greyscale, 0-255 image.

 

I have also tried:

a) invoke node on the front panel display. This does not work because I must save a 2560x1920 image while displaying a smaller image on the front panel. b) This advice: http://forums.ni.com/t5/LabVIEW/How-do-you-flatten-an-8-bit-pixmap-with-a-black-and-white-color/m-p/... , which recommends replicating the 8-bit array 3 times, piping that through interleave 1D arrays, then to the 24-bit input option in WriteJpeg. However, my arrays are 2D.

 

Please advise me on fixing this routine (attached PNG), or suggesting a better strategy altogether (I'm trying to avoid IMAQ and the Vision module).

 

Thanks!

Warren Harding

 

ArraytoImageAttempt.PNG

0 Kudos
Message 1 of 3
(2,925 Views)
Solution
Accepted by topic author Warren Harding

I would use the following to generate the color table.  I usually create a constant from the color table Array indicator and use that whenever I do this.

 

0 Kudos
Message 2 of 3
(2,913 Views)

Well done. This works now.

0 Kudos
Message 3 of 3
(2,900 Views)