• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
1

Substract duplicated pixels of 2 layers

Community Beginner ,
Dec 02, 2019 Dec 02, 2019

Copy link to clipboard

Copied

Hello everyone,

 

I'm struggling with a problem for about 2 months now and I cant find an easy solution (or a solution at all). I have 2 layers/pictures and I want to substract one of the layers from the other layer, so that the result gives me exact the pixels that are different of both layers. Both pictures have no transparencies in it and the result cant have transperency in it too obviously. I cant use Blend mode (or atleast it doesnt work when I try it) because there should be no tolerance, if the pixel is exactly the same color in both layers, delete it, if there is even a tiny difference, keep it.

Here are 2 example layers 

 

Layer1Layer1Layer2Layer2

 

If you compare both images you can obviously see that a lot of pixels are the same in both pictures, but I need layer 2 to just have the difference in pixels, without all the pixels that stay the same in both layers.

Views

1.9K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Dec 02, 2019 Dec 02, 2019
Hi,
"Image / Calurations ..." the two layers.
スクリーンショット 2019-12-02 19.48.54.png
 
result
スクリーンショット 2019-12-02 19.49.11.png
Look for "RGB = 0, 0, 0".
スクリーンショット 2019-12-02 19.55.56.png
Pixels with a difference of 0 are the same pixel.

Votes

Translate

Translate
Adobe
Community Expert ,
Dec 02, 2019 Dec 02, 2019

Copy link to clipboard

Copied

I am slightly confused by your requirement. You say the result cannot have transparency but then go on to say if the pixels are the same "delete it". Delete it and replace it with what if it is not to be transparent?

So to get the pixel differences use the difference blend mode. Pixels that are exactly the same will be RGB 0,0,0 and any that are different will anything  above that.

To go on to make all pixels transparent and just keep the originals where there was no exact match, put both in a group and set the group "blend if", in layer styles to "this layer 1-255". Then clip a copy of the original layer to the group. It will only show where the original layers are not an exact match.

Dave

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 02, 2019 Dec 02, 2019

Copy link to clipboard

Copied

Sorry I just meant that I dont want to have some transparent colors, either its the same color or its no color (transparent).

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 02, 2019 Dec 02, 2019

Copy link to clipboard

Copied

The identical pixely might be fewer than you expect. 

The Difference Blend Mode with a Threshold Adjustment Layer and Blend if-settings on a Group might be helpful. 

differenceToTransparencyTestScr.png

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 02, 2019 Dec 02, 2019

Copy link to clipboard

Copied

I dont know what the fault in this procedure is, but it seems to be incorrect as there appear to be way more identical pixels as seen in the answer below, which seems to be correct. 🙂 But thank you for your effort, I really appreciate it.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 02, 2019 Dec 02, 2019

Copy link to clipboard

Copied

LATEST

A difference of even one value in one channel means: Not the same. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 02, 2019 Dec 02, 2019

Copy link to clipboard

Copied

Hi,
"Image / Calurations ..." the two layers.
スクリーンショット 2019-12-02 19.48.54.png
 
result
スクリーンショット 2019-12-02 19.49.11.png
Look for "RGB = 0, 0, 0".
スクリーンショット 2019-12-02 19.55.56.png
Pixels with a difference of 0 are the same pixel.
--
Susumu Iwasaki

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 02, 2019 Dec 02, 2019

Copy link to clipboard

Copied

Thank you very much for this answer. Could you ellaborate how to look up for a specific rgb value? I did everything as you stated and selected the values of rgb 0 0 0 with the magic wand and copied them into a new layer and it looks quite similar to yours and it actually works when I put it over the first layer but Im still wondering why there are differences between our pictures. I guess its some compression fault for the uploaded picture.result.png

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 02, 2019 Dec 02, 2019

Copy link to clipboard

Copied

Hi,

Difference between actual image and screenshot?

 

Sample Size: Point Sample, Tolerance: 0, Anti-alias = off, Contiguous = off

Screen Shot 2019-12-02 at 21.56.22.png

 

--
Susumu Iwasaki

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 02, 2019 Dec 02, 2019

Copy link to clipboard

Copied

Hey,

 

Yes that was exactly the way I did it. And no I mean the difference between our results actually. I have way more identical pixels with exactly the same method, so I guess the downloaded pictures you used had sligthly different colors to start with.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Dec 02, 2019 Dec 02, 2019

Copy link to clipboard

Copied

layer2 over layer 1

layer2 mode = subtract

selection from RGB

save sesection as s1

 

layer1 over layer2

layer1 mode = subtract

selection from RGB

save sesection as s2

 

layer2 and layer1 mode = normal

 

load selection s1

load selection s2 (add to selection)

 

create mask from selection to layer1

stay on mask, edit->adjustment->treshold=1

 

copy mask to layer2

invert mask on layer2

 

you get layer1 (or  layer2) in result.

 

invert mask on both layers = you will get anoter layer

 

 

 

 

 

 

 

 

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines