LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
BruceAmmons

Add function to convert string to image

Status: New

Currently in IMAQ Vision, there is a function to convert an image to a standard formatted string (JPEG, PNG, etc.).  The contents of the string is exactly the same as the data that is normally written to a file.  This is a great function to compress an image and send it over FTP, etc.

 

The problem is that there is no inverse function available - you can't convert the string directly to an image.  The only way to do it is to save the string to a file, then read it as an image, which slows down the process significantly.

 

I repeatedly see the need for this function.  People receive strings from other devices or PCs and want to display them as images.

 

There are functions to flatten images to/from strings, but they are limited in their scope (JPEG and PNG only, I believe) and they include the image name and other information in the string.  The format is proprietary and can't be read by other programming languages (yes, some people still program in languages other than LabVIEW).  It is also difficult when you want to unflatten a string and store it in an image with a different name than it was stored with.

 

Bruce

 

[Update] Part of this idea for the PNG format was implemented for LabVIEW 2013. Please see this post for details.

Bruce Ammons
Ammons Engineering
22 Comments
dadreamer
Active Participant

For anyone interested in this here's a WinAPI method to convert an image stream into a common 32-bit RGB array. Doesn't require saving a stream into a temporary file.

Plumbob
Member

We could use this ability to convert jpgs in memory in our Dissolution muiti camera application.