I've been trying to figure this out for a while but can't seem to, so I'm asking here.

Imagine I have an original image, like for instance this one:

enter image description here

Then I mess with it a bit, add some tinting, add some clouds, and get this image at the end:

enter image description here

However, suppose I lost the history of the changes I made, so that at the end all I have is these two images and nothing else.

Is it possible to do something that will recover a layer that basically "applies the same changes" to the original image? That is, something like an image that is equivalent to applying a hue/saturation to every pixel of the original image that gets the new image?

Of course I can't recover anything that was "background", I won't be able to figure out what's "behind" Thanatos in the second image, but I'd like to at least have some way to regenerate the "mist" and the "tinting" that are in front of/on top of Thanatos so that I can generate the green tint and misty effects on him starting from the original image again. I had hoped that messing around with difference or subtraction layers and all that jazz would help, but no dice so far.

Clarification edit:

In principle, if I have an origin pixel with colour (R1, G1, B1) and a target pixel with colour (R2, G2, B2), there exists a unique tuple (x, y, z) such that (R2, G2, B2) = (R1, G1, B1) + (x, y, z), right? So what I'd like is a layer that has (x, y, z) for every pixel of the original image plus some way to combine the original layer with this new layer to obtain the final layer.

(And of course (x, y, z) would need to be mod 255 and so would the sum, since negative colour pixels don't exist.)

Of course if you include an alpha there the answer is no longer unique, right, since (x, y, z, 1) is the same as (2x, 2y, 2z, 0.5) in terms of what it adds to the original layer? As I understand it? But I'm fine with assuming alpha = 1 everywhere (and giving the original image a black background if that's necessary) to make the answer unique.

  • 1
    I'm unsure if it's an exact duplicate, but isn't your question basically the same as this? And this more recent question which was closed as a duplicate of the first? In other words: I don't think it's possible. 🤷‍♂️
    – Wolff
    May 9, 2022 at 20:01
  • ermmm... clouds filter and a mask... or clouds filter on a mask.
    – Scott
    May 9, 2022 at 20:18
  • @Wolff yeah i saw both of those questions but they don't really answer the same thing i think? the more recent one is not what i want because like i said i don't actually care about the "background" parts, and the other one says it's impossible to restore layers if the alpha channel is not 0 or 1 but that's not an issue in principle, if i have an original pixel with some (R1, G1, B1) and a target pixel with some (R2, G2, B2), there is a unique tuple (x, y, z) such that (R2, G2, B2) = (R1, G1, B1) + (x, y, z). I want a layer that has (x, y, z) for every pixel in the original image
    – Red
    May 9, 2022 at 20:39
  • 1
    @Pedro, you say yourself that there is only a unique answer if we assume alpha = 1. But the pixels of the green cloud covering the character must have many different opacities. Also see this question. If you have an image which is a blend of a background image and a top image with some alpha, you can recreate the top image if you can guess the alpha. But if all pixels have different alphas I don't think it's possible without some AI. Check out my JSFiddle which automates "unblending".
    – Wolff
    May 9, 2022 at 21:20
  • 2
    Do realise that the example image you are using is copyrighted, and anything you post on here is automatically released in CC BY-SA 4.0. You may want to remove this image and give another example.
    – Vincent
    May 10, 2022 at 9:47


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.