11-19-2014 06:44 AM
Hey there!
I want to convert an 32-RGB image to a simple 1-bit image, meaning it has a colour depth of 1-bit. I tried the following:
This was the simplest solution I could come up with. And yet it only shows me completely white images, regardless of its input. What goes wrong? And how can I solve it?
			
    
	
		
		
		11-19-2014
	
		
		06:55 AM
	
	
	
	
	
	
	
	
	
	
	
	
	
	
 - last edited on 
    
	
		
		
		09-30-2025
	
		
		04:57 PM
	
	
	
	
	
	
	
	
	
	
	
	
	
	
 by 
				
		
		
			NI_Community_Su
11-19-2014 07:05 AM
I looked inside the VI's, but they are kinda complicated (The 24-bit data returns ' FEFE', and I don't know what that means). Could you give an example as to how I could do convert it?
11-19-2014 07:08 AM
I miss a threshold, at what level(s) of the RGB pixel value(s) do you want to set a 1 or a 0?
and if you read the help for the unflatten Pixmap vi you will find that the data is just unflatten to ONE of the output arrays (the one that fit to the pic data) you have to reduce it by your own.
11-19-2014 07:57 AM - edited 11-19-2014 08:08 AM
I played 🙂
the sliders on the left (org) pic move both with a sledge hammer method (timeout and properties), how would a nice event driven solution look like?
11-19-2014 12:38 PM
I played too.
I like the array-based RGB deconstruction. I've always hated going pixel-by-pixel through an image in order to use "color to RGB.vi". Has anybody every put "make color to RGB accept 2D inputs" on the idea exchange...I'll have to check.
I moved the deconstruction outside the loop so it's only done once and I added RGB weighting per human perception. The thresholding value will now be a number between 0 (black) and 255 (white).
There are coersion dots all over, but what's a little coersion between friends?