LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Low quality images when imported into LabVIEW

Solved!
Go to solution

I want to use a tree control with custom symbols. I have prepared some png images to be used:

1_thermostat_16dp_434343-01-01.png

 2_water_drop_16dp_434343-01-01.png

 3_light_mode_16dp_434343.png

 4_oxygen_16dp_434343-01-01.png

They look fine here with the native resolution of 16x16. They are created in Adobe Illustrator and exported as png with a resolution of 72 ppi.

When I read them into Labview and displayed in a picture they come out with very low quality:

Basjong53_0-1729675814802.png

Basjong53_1-1729675821111.png

It seems like anti-aliasing or transparency is removed or something. Changing the Transparency Thres input of the Read PNG File.vi doesn't do the quality any good.

 

How can I get the same quality as the actual images in LabVIEW? I have attached the images.

 

 

    

0 Kudos
Message 1 of 8
(228 Views)
Solution
Accepted by topic author Basjong53

Use vi.lib\picture\PNG\Draw Flattened Blended Pixmap.vi

cordm_0-1729678279062.png

 

 

(found out about it here: Create pictures with different opacity levels, there since LV2020)

Message 2 of 8
(212 Views)

I succeeded to have the result from the video only by wiring the 24-bit pixmap to the Convolution.vi that I called only once with Y input {0 -1 0} {-1 4 -1} {0 -1 0}

0 Kudos
Message 3 of 8
(184 Views)

can't download the files (probably need to be registered to lavag?)

0 Kudos
Message 4 of 8
(170 Views)

@cordm  ha scritto:

Use vi.lib\picture\PNG\Draw Flattened Blended Pixmap.vi

cordm_0-1729678279062.png

(found out about it here: Create pictures with different opacity levels, there since LV2020)


Thank you, this function works great to get the images on a picture control. However, I want to have these images as symbols for a tree control. Setting the raw png image data as the custom symbols still gave the low quality symbols.

 

I found the solution however by converting the image data to pixmap using the "blended pixmap.vi" and converting it back to image data:

tree.png

 

Now the symbols look great!

Basjong53_3-1729683960095.png

Message 5 of 8
(166 Views)

I didn't really understand the difference between the two. When should I use Draw Flattened Blended Pixmap.vi and when should I use Draw Flattened Pixmap.vi

0 Kudos
Message 6 of 8
(128 Views)

Be aware that Picture to Pixmap cannot export alpha channel information. The image is blended (as the name suggests).

So if your particular tree cell has a different background color, you would need to create a filled rectangle with that color. Otherwise, you get your symbol on a white box on a green cell.

0 Kudos
Message 7 of 8
(99 Views)

@maxnoder1995 wrote:

I didn't really understand the difference between the two. When should I use Draw Flattened Blended Pixmap.vi and when should I use Draw Flattened Pixmap.vi


If you have a png with an alpha channel, the background will shine through. With Draw Flattened Pixmap, you get 1-bit transparency: either fully transparent or fully opaque.

 

A gradient from red to fully transparent will look like this (front panel set to white background):

 

cordm_1-1729696388697.png

 

 

 

snip.png

Message 8 of 8
(88 Views)