Appearance
Try to take screenshot of a dom node using built in screenshot utility (both chroe and firefox). The node has a shadow and rounded border.
it takes a dumb screenshot with white background. I decide to make the bg solid green and use VFX magic.
Tried using GIMP's color to alpha but it removes too much. border and bg are not semi transparent, shadow is gone. playing with thresholds doesn't help.
[done]
tried extracting masks from different channels.
[done]
I have control over the source image. I create two versions - one with green and one with magenta bg. I should be able to get something useful since the "data" is the same and the "noise" is inverted. <insert some info about audio signals and noise cancelation>
Let's add 😦. Of course that doesn't work. I an additive color model, green and magenta add together to give white. They don't cancel each other out. This only gives me a slightly brighter image with white bg.

tried difference it gives a nice mask. but using tat mask gives slightly greenish tint and is semitransparent. which makes sence since a mask will only affect the alpha channel, but the greenish shadow remains the same.


i am an engineer https://www.youtube.com/watch?v=1QKvOIZxPLo
so i play around with other blend modes. color-erase does exactly opposite of what i want. my data is gone, but i have and exact reconstruction of the noise.

One step closer. I duplicate the original image and try different blend modes with pure noise on top. again color-erase saves the day. I now have perfect transparent shadows without any of the background changing the actul values.

Close but the shadows are gone 😦.
Lets try something else. color-erasing with full green layer gives us:

This gives us decent shadows, but their color is off. Lets try using the color blend mode to swap the colors with the original image.

And combining it with the one with solid bg but no shadows:

adding a white bg below it and comparing it to the original with difference blend mode:

Here's and enhanced view of the difference using the histogram

Really amazing what we can do with just blend modes. I had never used color-erase before. I am sure there are other ways to do this, but this was a fun and discovery. This is particularly cool to me since there is really no human involved to adust special threshold values, draw masks or anything. I will probably turn it into a script to automate the process next time I need to do this.
Here's the original images used as imputs. Can you figure out a beter process.