Skip to main content
Participating Frequently
September 7, 2023
Question

Comparing bitmaps to assign color to pixels

  • September 7, 2023
  • 1 reply
  • 961 views

Is there a way to compare two different black and white images (png). These two tone images that are exactly the same dimensions. Is there a way to have adobe compare the two images (perhaps as layers), and assign a color based on the values comparision? I would also like to distinguish between the pixels that are different, based on how the difference layers (is it white and black, or black and white).

This topic has been closed for replies.

1 reply

c.pfaffenbichler
Community Expert
Community Expert
September 8, 2023

Please post the images. 

 

The Blend Mode »Difference« comes to mind. 

Edit: 

AlbdamnedAuthor
Participating Frequently
September 10, 2023

Thanks for your post. I will try this out with a red and green pic layer. I should have time later today. I would be happy to give jpeg versions of them, as BMP is not supported. The only reason I mentioned the bmp is the pixel map nature. I am more interested atm in getting the process down at the moment. I can give you examples that would work as a fun place holder. Both of thes images are blown up (102 times), and the grey has been dithered black. Based on 4 possible combination of overlapping pixels (black/black, black/white, white/black, white/white), I would like 1 of 4 colors.

AlbdamnedAuthor
Participating Frequently
September 12, 2023

For the second case I forgot to change the name of »x2« – the actual Blend Mode is »Linear Burn« (edit) and the two Curves Layers are not identical. 


I think the smart object is the ticket. The way I was thinking was to give different values (all with just cyan) to the 3 colors (Black from layer 1, black from layer 2, and white from either layer), and then use the conentration  to determine the colors. I have created a truth table that would take these 6 values, and convert it into the desired colors. Please note the colors in the table are not meant to be considered the colors I am using (excel does weird things with colors). I will try the guidance you have given.

 

I was trying to index the colors but it resulted in photoshop taking liberities that compromised the result. (with the truth table, you can look at 2 pixels, and see what the result should be).

I appreciate your efforts, and would like to apologize if my verbiage is off or I am being difficult with my exactness. I would like to explain that I have a background with philosophy and computers, (If it wasn't obvious with the truth table lol). I have a strong understanding in "if this, then that", which is 99% of what a computer does. I can usually navigate photoshop but becomes frustrated when there isn't a more code level adjustments like this. Ideally, I wish I could look at a spreadshead and enter formulas to cause the changes. If there was an easy way to convert a png to a CSV and vice-versa i would be set lol.