0

I have an image that has a stain right across it.

enter image description here

I think that I could remove it by (a) using the stain in the border to calculate a colour difference between the stained and unstained area (b) freehand select the stained area of the picture (c) subtract the colour difference from it.

But I don't know exactly how to do this. Would it work? Is there a better way?

Update: I've added the complete image of which the above is just a section. I probably should have done this in the first place for appreciation of the whole problem.

enter image description here

3 Answers 3

1

Addition/subtraction doesn't really work because our perception is not linear.

First let's see what we are up against, using the Histogram dialog, and a selection on the clean margin we get this:

enter image description here

(having a slight blue tint is normal for "white" paper)

If we change the selection to be inside the smear in the margin we get this:

enter image description here

So we can hope to remove the stain if we do:

R: 147 -> 157 
G: 144 -> 157
B: 141 -> 161 

We will fix this on a whole copy of the layer using the Curves tool, so for each R/G/B channel:

enter image description here

When this is done, you have a layer where the stain is the color of the original image, but of course the rest of the image is shifted as well. To obtain the final image, you put the original image over the fixed image, add a layer mask, and paint the mask (soft paintbrush, or airbrush) where you want to fix the colors. This lets you make a smooth transition and pick everywhere how much you want to fix the colors by adjusting the opacity of the initial image.

enter image description here

You could get a better result by doing the initial measure in the image itself (and not the margin). That would give a slightly better match in the image, at the expense of the margin. You can of course also do both...

1

I don't think the way you suggest would work TBH.

Here's a different approach.

  1. Make a layer mask on a duplicate layer

  2. Adjust the masked image using the hue-chroma adjustment to remove some a little of the chroma component - this should remove the yellowness of the stain.

  3. Use a curves adjustment to pull up the exposure of the shadows

  4. Blur the layer mask to blend it in.

enter image description here

You could continue to tweak this using the smudge tool to alter the mask. And use the dodge/burn tool on specific areas at a very low opacity, maybe even some clonestamp/healing tool work.

Anyway here's the result, not entirely perfect, although I think perfection would be almost impossible here TBH.

enter image description here

0

In GIMP you can mix the RGB channels of the image to greyscale with Color > Desaturate > Mono Mixer. In your case it seems to be possible to adjust the channel mix so that the brown stain becomes to approximately as bright grey as the surrounding wall areas:

enter image description here

If you also have colored shapes which should stay colored you can add another copy of the image to the top layer. Delete there other areas than the important colored shapes. Or insert a layer mask. Let the mask be full white at first and paint to the mask black on places which should be become transparent and show the cleaned bottom layer.

If fully neutral grey is not a good color for the wall you can colorize the cleaned bottom layer. Or add a colorizing mid layer which has layer blending mode "HSLcolor". Fill or paint there the right wall color.

If there's brown stain also on colored areas this all is useless. Much more advanced editing is needed. In that case it's impossible to decide what to do without seeing the whole problem.

1
  • I've added the complete image to the original question. Yes, there is colour but not much so it may work. Thanks for the suggestion - I'll try it as I will with the others, although it's all testing my GIMP skills!
    – ceperman
    Nov 15, 2022 at 12:50

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.