Jump to content

Custom data in PNG files


Recommended Posts

As many LabVIEW experts and other tech savvy people already know, Portable Network Graphics (PNG) format is wonderful. It supports the alpha channel for transparency, is unencumbered by patents, provides the option of lossless compression, is compatible with LabVIEW in several ways, and it can store customized information in addition to the image. The IMAQ Vision Development Module ships VIs that can read and write PNG files with "Vision Info". So, you can save an image and include stuff like the ROI and other overlays that can be loaded up later. That's all very nice, but when you try to peek under the hood all you find is a DLL call.

Now, Chris Relf (crelf) wrote in his book Image Acquisition and Processing in LabVIEW that "The source code to realize this techinique is available at the National Instruments Developer Zone". The thing is that now I cannot seem to find it.

Looking at the PNG file format itself, it seems simple enough to extract the text items. I just get that reinventing the wheel feeling, so I figured I'd ask around here if anyone has that example code lying around. Also, is there any documentation for how the IMAQ Vision Development Module stuff is storing the ROIs and stuff. I wouldn't want to mess that up, and it would be neat to be able to read that without making a dreaded DLL call.

Thanks,

Dan Press, CLA

PrimeTest Automation

Link to comment
Now, Chris Relf (crelf) wrote in his book Image Acquisition and Processing in LabVIEW that "The source code to realize this techinique is available at the National Instruments Developer Zone". The thing is that now I cannot seem to find it.

I hear that's a great book! ;) The code I was talking about is here. It uses a DLL call, but it's wrapped so you don't have to worry about how to get the data in there.

Link to comment

A great book indeed!

So, that code does allow reading and writing of some custom data in PNG files. The thing is, when examining a file that contains IMAQ "Vision Info" it does not show what the Vision Info is. Sure, there is a Version tag, a couple timestamps, an image type, an actual height (no data), something about lost packets, but no ROI data. That means that the ROI data is hidden somewhere else.

Oh... and what's with that pesky DLL? Shoud we change the name around here to DLLAVA?

Link to comment
So, that code does allow reading and writing of some custom data in PNG files. The thing is, when examining a file that contains IMAQ "Vision Info" it does not show what the Vision Info is.

Ohhhhh - I have no idea where the ROIs are saved. I'm the same as you - I would have expected them to be in the header info: if they're not there, then I don't know where they are...

Oh... and what's with that pesky DLL? Shoud we change the name around here to DLLAVA?

That's a great idea! The reason I use the DLL is because it's off-the-shelf, it works, which means I don't have to write or maintain it ;)

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.