3

I have two (actually more) images in layers, that share the background (an image of a book page), but differ in the text on the book page. The text is in english. I want to translate the text and display it on the page instead. So what I'm trying to achieve is to get a blank book page. My idea is that I take multiple of these pictures and find the common pixels, while erasing the differences. I tried changing the layer mode (essentially went through all the options), but no option returned a good result. The best one was Lighthen only, since the text is black, but then the background image broke in other places. Logically, I would need the opposite of Difference. Do you have an idea?

0

3 Answers 3

2

I would use a different technique to remove text from a page. This works quite well for a page with some texture/shading on it, although you might need to do some manual Clone Stamp retouches afterwards. Obviously success may depend on your image, but since you didn't share it, I'll use one I found online.

The Heal Selection (Resynthesizer) plugin is available here.

Here's an example:

Make a tight selection around the text using the Free (Polygon) Select tool.

enter image description here

Do Filters > Enhance > Heal Selection, here I set the sampling pixels to 60, but left everything else at defaults. If you have a large image it might take a few minutes, but worth the wait.

Here's the result

enter image description here

You can break up the patchiness using the Clone Stamp tool, set to a large soft edged brush and low opacity.

Here's the final result. When you you put knew text on this, it will help break up any inconsistencies even further.

enter image description here

1

The best way to do this is to use a Median filter. There is one in the GMIC filter suite plugin: given a set of overlapping similar images (in layers) it generates an image where each pixel is the most frequent pixel value(*) across the layers. This filter is often used to remove people from images of buildings, by taking several shots of the building.

enter image description here

If the text is white or black, an alternative is to set all layers to blend mode Darken only (for white) or Lighten only (for black). Between two layers where one is the plain background and one has black text, the Lighten only will make Gimp keep the lighter of the two pixels, and since black is darker than anything, Gimp will keep the non-text pixel.

enter image description here

However, with either technique you can have pixels that correspond to text in most/all images...

(*) technically, their median, but in this use case the result is usually the most frequent

0

What if you actually use "Difference", and work on it to be used as a mask?

You can convert it to grayscale and probably invert the curves. A blend mode is a tool; the result might not be exactly the one you need, so adapt it.

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.