>>75315
Basically I cropped images 1 and 2 to the top third of the image where they are identical except for the watermark.
The graphs show the relationship between pixel values in the clean image and the corresponding pixel values in the watermarked image. The y=x line corresponds to pixels outside the watermark - they're the same in both images. The other line corresponds to pixels which are covered by the maximally opaque parts of the watermark. The scattering of dots between the two lines come from the anti-aliasing around the edges of the watermark.
In the case of a monochromatic watermark, the color is given by the x (or y) coordinate where the two lines cross. The lines meet there because if the pixel value of the watermark is the same as the base image, it isn't modified (therefore y=x). Once we know the color of the watermark, we can calculate the alpha at each pixel with a bit of vector math.
Each color is a 3-vector.
base is the unmarked image.
marked is the watermarked image.
color is the watermark color.
We calculate vectors:
v1 = color - base
v2 = color - marked
The alpha at each pixel is then given by:
alpha = v1 dot v2/(|v2|^2)
where dot is the dot product and |v| is the magnitude or length of v.
(hopefully I didn't fuck up the formatting)
Once we have the color of the watermark and the alpha at each pixel, it's a simple matter to extend the pattern (each "sample" text is identical) and invert the alpha blending equation.
The code is all written in python. It's a bit of a mess, but I can share it if you want. It's not simple to use though. You can't just point it at an image and see the watermark vanish. There are still quite a few manual steps required, and there are a few magic numbers in the code which might need tweaking on a case-by-case basis.