From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.


Showing results for 
Search instead for 
Did you mean: 

Assign Filenames of Images

Go to solution

Here is my current VI...

0 Kudos
Message 11 of 20

It's error with WriteBMPFile cause you are deallocating (IMAQ Dispose) the Image inside the Aquisition Loop before save it.

0 Kudos
Message 12 of 20

How should I fix that?  I need to dispose of the images at some point right?

0 Kudos
Message 13 of 20
Accepted by topic author Max_2013

If there isn't before ... should be after, agree? 😄   



Message 14 of 20

Hmm, still not working.  Absolutely no files show up.

0 Kudos
Message 15 of 20

Sry, i had make one mistake. Image updated in previous post.


 Look  two attached examples. Both still working.


'm using IMAQdx Functions instead.




Download All
Message 16 of 20

I really appreciate your help!


Something pretty frustrating has just happened.  I wired an error message to the save BMP portion and noticed that the BMP selection resulted in an "invalid image type" error.  Can I not save my image as a BMP?!  That seems rather odd. 


So I decided to select PNG instead.  I actually named the file that I was saving as *.bmp, and checked my folder to see what happened.  It was a BMP image (hurray?), but I have a feeling that it is not a raw BMP.  Does selecting PNG and then writing .bmp compress the image and lose data or something?


And, any help regarding using write to file to actually save a BMP.


The rest of the code is working perfectly!


Thank you.

0 Kudos
Message 17 of 20

Functions: IMAQ ColorImageToArray, Flatten Pixmap and Write BMP File


Message 18 of 20

Ok, so I just realized the a 24 bit is probably unecessary.  I am working with grayscale images from a 12bit camera.  The images go straight to 16 bit, but the read in BMP VI does not support 16-bit.  How can I work with the arrays of these 16 bit images, also how can I save them as 16bit in the first place?


The code I wrote to work with the arrays is for 24 bit images.  So if there is an easy way to get the image to 24 bits in the first place I guess I could do that.

0 Kudos
Message 19 of 20

I think should be better consider force a "typecast " with IMAQ CastImageType Function to U16 (If need) and use PNG format and write into file using IMAQ WriteFile2 Function. U can swap the extensions (Putting bmp instead png) in filepath (Works as the same)... consider this like a pseudo-workaround 😄


I found it inside Read BMP File . Labview cannot handle 16 bits BMP. Even using Vision Toolkit (Always throws an error in Write BMP File)


Message 20 of 20