LabVIEW Idea Exchange

Showing results for 
Search instead for 
Did you mean: 

Add Compression Input to LV Image to PNG Data

Status: New

Under Web Services there is a conversion palette.  One of the functions here is to convert LV Image data to a PNG stream.  This is super useful when dealing with sending and receiving large amounts of PNG data over something like websockets.  I've used this in places where a web page can control a VI, and the image of some front panel controls can be sent to the web page.


However only recently did I realize this function turns the image into a PNG stream that is completely uncompressed.  This idea is to expose the Compression input to the VI.  Here is just one example where I get the image of a control then represent it as a PNG.  With no compression this file is over 64KB.  With just the most minimum compression that drops to 3KB, and down to 2KB under the highest compression.



Knight of NI

The underlaying LVImageDataToPNGByteArray function is used in Write PNG File. This change can be done in 10 minutes, if the VIs weren't PW protected.


While this is done, please add these as well (should be 10 minutes as well):

+ LV Image to JPG

+ JPG Data to LV


And please move or add them to the Graphics Format palette?

Proven Zealot

If anyone is interested in this feature, or supporting this function on other platforms, I made a post here that describes some of the things I did and gives example code of compression methods.