LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

bmp issue with Read BMP File VI

Solved!
Go to solution

@WavePacket wrote:

@Hooovahh wrote:

Also you can probably load the image in a .Net Picturebox.  Here is some code I posted for displaying an image and having it scale without needing custom code.

 

https://forums.ni.com/t5/LabVIEW/Read-multi-image-tiff/m-p/3580103#M1002365

 

I don't have a 32-bit BMP to test with, but it handles other alpha layer transparencies in PNG files just fine.


I just downloaded the image zip but when loading "Demo Load Image.vi" it said that it was missing "Current VIs Parent Directory_ogtk.vi". Any thoughts?


The _ogtk indicates it's part of the Open G toolkit, a free toolkit with some useful stuff in it available in VIPM.

Message 11 of 13
(431 Views)

@Hooovahh wrote:

Also you can probably load the image in a .Net Picturebox.  Here is some code I posted for displaying an image and having it scale without needing custom code.

 

https://forums.ni.com/t5/LabVIEW/Read-multi-image-tiff/m-p/3580103#M1002365

 

I don't have a 32-bit BMP to test with, but it handles other alpha layer transparencies in PNG files just fine.


Seems to work with the "problem 32-bit bmp" that I had. Thanks for additional solution.


------------------------------------------------------------------------------------

Please join the conversation to keep LabVIEW relevant for future engineers. Price hikes plus SaaS model has many current engineers seriously concerned...

Read the Conversation Here, LabVIEW-subscription-model-for-2022
0 Kudos
Message 12 of 13
(425 Views)

I had to look into this - so GIMP can create 32 bit BMP files

 There are two flavors:

alexderjuengere_0-1628803769385.png

 

argba and xrgba

 

exporting an imported 24 bit image, not modified in gimp,  in xrgba will do nothing. you can't export in argba.

if you modify the image in gimp via  "add alpha channel" , you can now also export in argba.

 

 

Python's Pillow Library can read those bmp files, which than can be returned as a numpy array. and we can use LabViews python node to get tis numpy array of pixel values as an array in LabView, like this:

 

 

0# 24 bit  
alexderjuengere_1-1628804047297.png

 

alexderjuengere_6-1628805162762.png

 

   
1# 32 bit xrgba  
alexderjuengere_2-1628804099830.png  
   
2# 32 bit argb (with alpha layer added in gimp manually)  
alexderjuengere_3-1628804155336.png alexderjuengere_5-1628804550897.png

 

 

 

 

 

code attached in LabView 2020 64bit, Python 3.7 installed globally

 

0 Kudos
Message 13 of 13
(404 Views)