Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I do to convert a ".PNG" image file to a ".JPG" or ".BMP" one?

My problem is to save an image (after processing and with overlay information!) to a standard file (JPG, BMP, ...); if I do it directly with the related VI's, the overlay information is lost; I can save the image in a ".PNG" file, which contains the complete information with overlay, but is not displayable on a LabView-less PC ! How can I do?
Thank you for your prompt answers.
Francois
0 Kudos
Message 1 of 3
(3,691 Views)
Hello Francois,

As you noted, BMP and JPG file formats do not support overlay information. There are two approaches to your problem.

1. Write to PNG file. PNG is not a LabVIEW specific file format. It cannot, however, be read by simple programs such as Windows Paint. Paint Shop Pro, Photoshop, among other more robust image viewing and editing programs can handle PNG files that LabVIEW generates.

2. Flatten the overlay information into the main image before writing to BMP or JPG. I don't believe this functionality is built-in to LabVIEW, so this would require some programming, perhaps quite difficult. That is why LabVIEW supports PNG files.

Jeff Boettcher
National Instruments
0 Kudos
Message 2 of 3
(3,691 Views)

The flattenen can now be done easily with the flatten and unflatten pixmap vi's: Just open the png file, flatten the pixmap, unflatten it again and write it to jpg file. Attached via converts all png files in a directory to jpg files witch take a lot less space.

0 Kudos
Message 3 of 3
(3,128 Views)