Removing text from image

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
mzorova

Removing text from image

Post by mzorova »

I have a map that has a bunch of streets and names on it that I am trying to remove - to be replaced by some averaging of the background. Some text is large (so the averaging diameter has to be large) and some text is small (so averaging diameter needs to be small)

I am currently doing this via a Java program and would like to see if there is anyway to use IM to do the same. The background only uses about 4-5 colors - so I need to replace ANY pixel that is not one of those 4 colors with the above kind of averaging (to effectively remove the text)..

I can upload the images, but they are pretty large images (and hence the research into IM)..
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Removing text from image

Post by Bonzo »

Could you just paste a section of an image if they are large?
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Removing text from image

Post by anthony »

Sounds like a masked mean filter.

generate a second image that replaces each pixel with the most common surrounding color.

Now generate a mask from the original, and make all the test black, and all the other background colors white (or visa-versa if that is easier).

Not you can compose a masked copy of the second image on top of the the first to remove the text.
http://imagemagick.org/Usage/compose/#mask

If you have a small 'cropped' example I am sure either myself or bonzo, or someone can generate the exact commands you need.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
mzorova

Re: Removing text from image

Post by mzorova »

Image
Post Reply