LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Imaq: how to decode PNG

Hi Thomas -

 

A little more investigation shows it's not to do with the image size, but with the range of values in the image.  If you have a 2-pixel image with values of -32768 and 0, it seems to read ok.  It seems that the .NET routine may be rescaling any image that doesn't contain 16 bits of information to "fill" the 16-bit range, but not retaining individual values - looks like the minimum is always -32768.  I've looked on MSDN but noone has discussed anything similar as far as I can see. You may wish to look there further, and ask what is going on.  The pixel format for these 16-bit images is Gray16.

 

For the RGB images, the pixel formats are either Bgr24 (when PreservePixelFormat is selected) or Bgr32 (for None), so there is no alpha channel recovered in either case.

 

Sorry I can't be of more help.

Cheers ~ Greg

 

Message 21 of 24
(1,000 Views)

This issue was resolved in a simpler way here.

 

Florian

0 Kudos
Message 22 of 24
(672 Views)

...and here is the code...

0 Kudos
Message 23 of 24
(661 Views)

Fianlor: Your post does not deal with the issue of decoding the PNG and the example stacked sequence structure is very unreadable.

 

To the original subject of this thread: Thank you, guys, very much for your code. It is really practical and it works fairly fast. I wonder whether there will ever be a Read PNG From String function, possibly with RT support, but this one works great!

0 Kudos
Message 24 of 24
(520 Views)