LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

open png file

Using Labview with Measurement & Automation (MAX) software
I am able to grab a 10bit image using a IMAQ 1409 board and save the
image as a PNG file.
How can I re-open this file for viewing using a NI or third pary viewer.
PhotoShop or Activiewer do not open the image correctly.

Thanks
0 Kudos
Message 1 of 7
(4,498 Views)
LabVIEW can read in PNG files directly.

Look on the functions palette in the 'Graphice & Sounds' sub palette, then the 'Graphics Formats' sub palette in there. There's a VI for reading the PNG file and another for assembling the info into something that LabVIEW can display.

Ed


Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 2 of 7
(4,488 Views)
Ed is of course right, but one of your sentences really worry me.

If Photoshop cannot open your PNG file, maybe there is something wrong with the file format. How exactly do you generate the PNG file???

You can also try to open the PNG file directly in a web browser. Any modern web browser (IE, Firefox, etc.) can display PNG files. If that fails too, your files are definitely not in proper PNG format.
0 Kudos
Message 3 of 7
(4,478 Views)
I missed that last line. Good catch.

LabVIEW can draw 1,4,8 and 24 bit images using the built-in functions. So you may run into the same problem.

Any possible way you can change the 1409 board to save it as an 8 or 24 bit image? That should solve the problem.

Ed


Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 4 of 7
(4,463 Views)
I can open my 10 bit image.png file in other viewers but the image
is black and w/o detail. The image displayed is not the one I was
shown after the image capture. Image is too dark in some viewers or the
pixels are **bleep**ed causing a distorted image.
A NI or third party viewer would be nice to have that could open the image
and save it in a different format w/o loss of data.
I need to capture 10bit data, so capturing 8 bit data works but not the
detail I require.


steve
0 Kudos
Message 5 of 7
(4,452 Views)
If I correctly read the PNG 1.2 specification, it seems that 10bit PNG is not an allowed combination (See page 16 of the above document). Maybe you can expand it to 16 bits? Another possibility is wrong byte order in the file.

I am no expert here, just guessing. More resources can be found at the official PNG site.

How exactly are you generating a 10bit PNG image???
0 Kudos
Message 6 of 7
(4,431 Views)
The reason the image appears black in 3rd party viewers is generally not a result of the PNG specification, rather it is a result of what bits in your 10-bit image the different programs use to display the image. It is common for 3rd party applications to take a 16-bit PNG, shift it right by 8-bits, and then only display the image over that final 8-bit range. This can cause problems if you have a 10-bit image where the most significant bits are being shifted out by these other applications, like Photoshop. My guess is this is the problem you are running into with your images. Take a look at the following KnowledgeBase, which reiterates what I am saying here:

Why Does My 16-bit PNG Image Saved Using IMAQ Vision Appear Black in Photoshop or Photo Editor?

I hope this helps answer your question and let us know if you are still having problems!

Regards,
Michael
Applications Engineer
National Instruments
0 Kudos
Message 7 of 7
(4,408 Views)