Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Extracting Identical Pixels Between Two Layers
#3
Another way

This is from here: https://graphicdesign.stackexchange.com/...ge-in-gimp and sort of ties in with your other post.

The two images as layers
Using the bottom layer Filters -> Animation -> Optimize (Difference)
That makes a new image and the top layer has an alpha channel of the common pixels
Layer -> Mask -> Add Layer Mask -> Layers Alpha Channel

Then on the bottom layer using a script (attached) to copy the layer mask without going through the make / copy / paste / anchor routine.
Click in the layer mask to make active and invert it Colors -> Invert
If you just want that result, one way is Layer -> New from Visible.

Attached sg-copy-mask-from-above.zip Unzip and put sg-copy-mask-from-above.scm in your Gimp User Profile folder C:\Users\"yourname"\AppData\Roaming\GIMP\2.10\scripts

Another quick animation, using a very obvious magenta dots common pattern https://i.imgur.com/LHC7JDA.mp4


Attached Files
.zip   sg-copy-mask-from-above.zip (Size: 1.37 KB / Downloads: 303)
Reply


Messages In This Thread
RE: Extracting Identical Pixels Between Two Layers - by rich2005 - 12-15-2023, 11:22 AM

Forum Jump: