11-09-2011 11:23 PM
I'm trying to read a 1-bit depth BMP file into LabVIEW, but using the 2D Picture Control it keeps on coming out black. It opens fine in Paint/PhotoImpact applications and I can see the image as a boolean array (1-bit pixmap) using the code below - so how can I display the actual BMP image using LabVIEW? NOTE: The attached ZIP file contains the offending BMP image - not allowed to attach BMP files directly - thtat's odd?
Solved! Go to Solution.
11-10-2011 12:23 AM - edited 11-10-2011 12:28 AM
Your colors are not RGB, but 32 bit. White is defined as xFF000000 instead of x000000 and black is defined as 0xFFFFFFFF instead of 0xFFFFFF.
If you rewrite to colormap correctly, the image looks OK, see attached modification (LabVIEW 2010). I don't know enough about all this to decide if it is a bug or not.

11-10-2011 12:51 AM
Top marks Altenbach - and so quick - you are a Knight of the 1st Order - thanks
Chris
11-10-2011 01:04 AM - edited 11-10-2011 01:04 AM
11-10-2011 06:11 PM
@altenbach wrote:
Your colors are not RGB, but 32 bit. White is defined as xFF000000 instead of x000000 and black is defined as 0xFFFFFFFF instead of 0xFFFFFF.
I don't know enough about all this to decide if it is a bug or not.
It is tricky since the fourth byte of the RGBQUAD struct is supposed to be 0. Two places to assign blame here IMO, the program which generated this file should not have written 0xFF into that byte and LV should not put any value into that byte except for 0x00.
If I were NI, I would change the Read BMP Header Info.vi to put a 0x00 into that spot instead of whatever happens to be read since it is such a simple change. In the meantime use the workaround. Next I would probably take a look at the program used to generate this particular BMP file since it seems to be straying from the specification.
11-11-2011 12:01 AM
Hi Darin,
The image was generated from the Brother SDK for creating labels on their range of Brother P-Touch Printers.
I will send them a gentle reminder that perhaps they should check their Export Image Method - thanks.
Chris
04-27-2012 05:22 PM
Hey, I have a project, in which your program seem to be part of it, but the problem is that i want take a picture from a camera, and process it to a 1-bit matrix, in which white would represent light/low contrast colors and black dark/high contrast colors. I hope u can help me soon, any ideas are welcomed.
04-27-2012 05:28 PM
steinbergsteiger@gmail.com wrote:
Hey, I have a project, in which your program seem to be part of it, but the problem is that i want take a picture from a camera, and process it to a 1-bit matrix, in which white would represent light/low contrast colors and black dark/high contrast colors. I hope u can help me soon, any ideas are welcomed.
This is a long thread already marked as solved. Which "program" is part of your project? Be more specific!
I think you should start a new thread with your new question.