LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Picture to Pixmap (8-bit input )

Solved!
Go to solution

Hello everyone, 

I'm new here and I started working with labview few weeks ago so bear with if what I'm asking is trivial.
What I'm trying to do here, as a first step, is to transform a digital signal to an image. 
Following this first process, I'm trying to get back again to the digital signal starting from the obtained image. ( just to check the reversibility of my code )
I'm using 8 bits tables with the same color table,  but unfortunately I can't find the same pixmap. 
I did check first the existing topics but I didn't find an answer to my problem
In order to make my problem more clear, you can find the VI and an illustration of my problem in the attachement.

Download All
0 Kudos
Message 1 of 7
(2,824 Views)
Solution
Accepted by topic author AaAymane

@AaAymane wrote:

I'm using 8 bits tables with the same color table,  but unfortunately I can't find the same pixmap. 


I don't think so.

 

You don't provide the first Flatten Pixmap.vi with a color map. So it will use it's own. Create a "Color table" property node from the original u8 intensity graph, and at least the picture control "new picture" will look the same as the intensity graph.

 

The picture control uses 24 bit colors. When you get an U8 image from it, you'll get burned by it, because it will use it's default color table, supporting a variety of colors. So you're colors get messed up.

 

The only solution would be to get a 24 bit pixmap from the picture and then manually convert it to an U8, either by using the given color table if it's available, or by manually making a new color table (as the picture should have less then 255 colors).

Message 2 of 7
(2,804 Views)

Here's the same VI with a color table generated from the pixmap. Note that the color table needs to be fed to the last flatten pixmap as it's kinda arbitrary.

0 Kudos
Message 3 of 7
(2,796 Views)

thank you for your answer, but I don't think that I understand clearly what you said because I do use the same table color for both process ( First attachment: the table that I'm using is the same one used by Labview by default ). 
I did use your VI but I still have two different images since the intensity Graphs are different. 


Download All
0 Kudos
Message 4 of 7
(2,783 Views)

Are you sure the intensity graph color table is the one you provide to the pixmap? It made a difference for me...

 

That Vi you just posted doesn't seem the same as the original one? That one had no color table IIRC.

 

Did you try both VIs I posted? The first has all 0's for the difference...

0 Kudos
Message 5 of 7
(2,770 Views)

Thank you so much for the help.

I'm sorry, I didn't post the right VI. I included your  modifications into my VI to adjust it and now it's working. ( Attachement ) 
Yet, I still don't understand why I can't just converts pixmap to image data cluster by using directly 8 bits instead of converting it using 24 bits and decimate it after that.
 

0 Kudos
Message 6 of 7
(2,757 Views)

https://en.wikipedia.org/wiki/8-bit_color

 

Note the mentions of palettes. For any given 8-bit data anything from greyscale to kaleidoscopic psychadelic effects may be possible.  In essence, the 8-bit Image AND palette give the final result.

 

A favourite tidbit of mine. The old shooter "Doom" used a relatively grubby, brown-dominated palette for its graphics.

https://zdoom.org/wiki/Palette

 

THIS happens when messing about with the Palette (but the underlying game doesn't know that)

0 Kudos
Message 7 of 7
(2,751 Views)