LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

array to 32 bit png

Hello,

I am trying to take a 2d array and create a 32 bit .png file.

I would like to make a translucent image of the array (sound intensity map) and place it over a jpeg of the part that was scanned.

The "Get Image" invoke node only allows for 24 bit. I plan to pass the image to the "create mask by alpha" VI I found here.

any help is appreciated.

Timm
0 Kudos
Message 1 of 4
(2,945 Views)
Timm,

When you say that you are trying to build a 32-bit .png file, are you trying to build an color image or a grayscale image? If you are trying to create a color .png, that can be accomplished. How are you assembling the image? I would suggest creating a 2D array of U32 values where each value is determine by using the 1st 8 bits as your Red value, the next 8 as Green and the next 8 as Blue. You could then use the IMAQ ArrayToColorImage function. Then, to build the .png file, you can use the IMAQ WriteFile function and specify the image type as PNG.

For adding the images together, you could try using the IMAQ Add function. I am not familiar with the Create Mask by Alpha VI that you referred to. Could you provide some additional details about what that function does?

Also, what software versions are you using (LabVIEW, IMAQ, Vision, etc)?

Regards,
Scott R.
Applications Engineer
National Instruments
Scott Romine
Course Development Engineer
National Instruments
0 Kudos
Message 2 of 4
(2,923 Views)
Scott,

Thanks for the reply. I am using Labview 7.1 professional developer. I have been able to make the picture translucent but it doesn't seem to work that great (i.e lines on the picture). I would also like to have the cursor funtionality of the intensity graph on the picture, is there a way to do this?

I have attached all the files I am using. If you don't mind take a look and see if you notice any thing I am doing wrong or couls improve.

Thanks

Timm
0 Kudos
Message 3 of 4
(2,905 Views)
Timm,

The files that you attached did not seem to include the "TIMM Read From Spreadsheet File" VI, so the VI will not execute on my end. It looks like you are masking out data to make the pixels tranlucent. Masking means that pixel data is being ignored which could result in the lines that you are describing. If the goal is to merge this translucent image onto another image, then I would suggest trying to use the Vision Development Module utilities. There are tools there that are designed to add or combine images. The module was developed for the explicit purpose of manipulating and analyzing images. Are you using either the NI-IMAQ drivers or the NI Vision Development Module?

Unfortunately, there is not any way to add cursors to the picture control.

Please let me know if you have any additional questions on this issue.

Regards,
Scott R.
Applications Engineer
National Instruments
Scott Romine
Course Development Engineer
National Instruments
0 Kudos
Message 4 of 4
(2,888 Views)