RSS/Atom feed Twitter
Site is read-only, email is disabled

How to "clean" the photo of the paper with drawing?

This discussion is connected to the gimp-user-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

3 of 3 messages available
Toggle history

Please log in to manage your subscriptions.

How to "clean" the photo of the paper with drawing? Milan Vancura 30 Sep 18:59
  How to "clean" the photo of the paper with drawing? Bruno Postle 02 Oct 00:23
How to "clean" the photo of the paper with drawing? Milan Vancura 05 Oct 10:08
Milan Vancura
2010-09-30 18:59:14 UTC (over 14 years ago)

How to "clean" the photo of the paper with drawing?

Hello all,

I tried to find tips how to "clean" a photo of the drawing but with no success. I have a photo of a paper with drawing (usually a combination of heavy lines by marker and thin pencil ones) and want to improve the image for printing. So I want to get white background of 100% of the image (no shadows) and still have all details of drawing kept. Even if they are sometimes lighter than shadows in different part of the image. For example a dark shadow in the cormer and light pencil line in the middle.

I tried to play with brightness & contrast. This is not good enough as many details are lost. Typically the pencil drawing. "Levels" are unusable for the same reason.

I tried to look for edge-detection filters but they all do something else than I need: they left a thin line around the edge, not the original line itself.

Probably a FFT (Fast Fourier Transformation) filter would help but I did not find any.

Any ideas, please?

Milan

Bruno Postle
2010-10-02 00:23:28 UTC (over 14 years ago)

How to "clean" the photo of the paper with drawing?

On Thu 30-Sep-2010 at 18:59 +0200, Milan Vancura wrote:

I tried to find tips how to "clean" a photo of the drawing but with no success. I have a photo of a paper with drawing (usually a combination of heavy lines by marker and thin pencil ones) and want to improve the image for printing. So I want to get white background of 100% of the image (no shadows) and still have all details of drawing kept. Even if they are sometimes lighter than shadows in different part of the image. For example a dark shadow in the cormer and light pencil line in the middle.

This is what I do:

Duplicate the layer and remove all the dark lines/text with the Dilate filter, repeat until they are all gone.

Gaussian Blur this duplicated layer with a large radius.

Effectively you want to subtract this duplicated layer from the original, do this by setting the layer Mode to Grain Extract, then Flatten.

The result will have an even grey background, adjust the Levels to make it white again.

This works very well, I use it for cleaning up photos of sketches, whiteboards etc... There is an alternative method using a Convolution Matrix, but it doesn't get such good results for me.

Milan Vancura
2010-10-05 10:08:10 UTC (over 14 years ago)

How to "clean" the photo of the paper with drawing?

Duplicate the layer and remove all the dark lines/text with the Dilate filter, repeat until they are all gone.

Gaussian Blur this duplicated layer with a large radius.

Effectively you want to subtract this duplicated layer from the original, do this by setting the layer Mode to Grain Extract, then Flatten.

Thank you, Bruno.

I tried this and it works quite well.

I also found another way meanwhile: Decompose the image by Wavelet function (part of my gimp 2.6 or as a plugin http://registry.gimp.org/node/11742 ) and "clear" the first layer - the one with details of larger scale - with the neutral color (128,128,128). Or fill that layer with white and set the brightness and contrast of the image after it is flattened again.

I'm surprised there is no tutorial about this - probably a good chance to write new one - when I get really good results.

Milan