Page 1 of 1

Can we remove the watermarks using ImageMagick

Posted: 2011-07-08T05:23:32-07:00
by Akkisai
Technical Team,

Issue: Need to remove the watermark(text) diagnally right placed on a .tiff image which consists of text, Both the image text and the watermark text are in the same color(Black).

Critical issues:
1. The watermark text is placed diagnally right on the background of image(.tiff) file.
2. The image file is a scanned format of Document.
3. It is observed that when each pixel values are read from the image, there is no diff between the RGBA values for Text on Image and watermark text.

Can we overcome the issue using Imagemagick tool.

Please sugest the ways to resolve the issue.

Re: Can we remove the watermarks using ImageMagick

Posted: 2011-07-08T05:56:03-07:00
by anthony
It would be likely impossible to determine if a pixel in the watermark area should be on (for underlying text) or not. Especially without shading (greyscale) effects in the scan.

However if you like to post a small cut-down sample of the problem, people on the forum can give it a go, and make suggestions. Without a sample we'd be simply guessing!

Re: Can we remove the watermarks using ImageMagick

Posted: 2011-07-08T06:35:09-07:00
by glennrp
4. Removing such a watermark would almost certainly be a copyright violation, if you didn't create the image yourself in the first place, and the person placing the watermark had the right to do so.

Re: Can we remove the watermarks using ImageMagick

Posted: 2011-07-12T04:08:19-07:00
by Akkisai
anthony wrote:It would be likely impossible to determine if a pixel in the watermark area should be on (for underlying text) or not. Especially without shading (greyscale) effects in the scan.

However if you like to post a small cut-down sample of the problem, people on the forum can give it a go, and make suggestions. Without a sample we'd be simply guessing!
1.The sample image is given in the below link.
http://www.flickr.com/photos/65102804@N ... otostream/
The background text "Not" in the image is the watermark which is to be removed.


2.There is no copyright issue involved.

Re: Can we remove the watermarks using ImageMagick

Posted: 2011-07-12T05:48:56-07:00
by glennrp
Since the watermark lines are very thin with respect to the main text,
noise reduction should do it, although the main text will be damaged somewhat:

Code: Select all

convert -noise 4x4 input.jpg output.jpg
unless there is fine print elsewhere on the document; that will disappear along
with the watermark!

Re: Can we remove the watermarks using ImageMagick

Posted: 2011-07-12T09:02:35-07:00
by fmw42
morphologic close might be a better way to go -- seems to remove the thin lines without too much distortion of the main text.

convert 5929918592_946af57ae2.jpg -morphology close diamond 5929918592_946af57ae2_close.jpg

see http://www.imagemagick.org/Usage/morphology/

Re: Can we remove the watermarks using ImageMagick

Posted: 2011-07-13T06:05:33-07:00
by Akkisai
Thankyou so much.

The "morphologic close diaomand" command worked for my image(WaterMark disapeared).

But the problem is the remaing text in the image had disturbed a bit.
Can we limit this disturbance to a limited area,so that the disturbance is limited to the text under which the watermark is removed (or) can we sharpen the remaining text after the watermark is removed.

The WaterMark in the image is placed diagnally left to right in the middle of the image file.

Re: Can we remove the watermarks using ImageMagick

Posted: 2011-07-13T07:39:57-07:00
by Bonzo
You could probably use -region something like this ( change the dimensions in region to reflect the area you want to modify ):

Code: Select all

convert 5929918592_946af57ae2.jpg -region 160x180+35+30 -morphology close diamond 5929918592_946af57ae2_close.jpg

Re: Can we remove the watermarks using ImageMagick

Posted: 2011-07-13T18:23:21-07:00
by anthony
Alturnative is to enlarge the 'closed' text ('erode' the white background), and use it as a mask of the original image.
But you may be left with small pixels from the watermark attached to edges the letters.

basically it comes down to 'how disturbed' you want it.

Re: Can we remove the watermarks using ImageMagick

Posted: 2011-07-15T06:11:25-07:00
by Akkisai
Can we get the region shown in the below image(Red marked) using the -region option with convert command.
http://www.flickr.com/photos/65102804@N07/5939977114/

How to combine the below two into one command line argument.
1.convert GoodMorning.png -region 360x380+300+320 GoodMorning_level.bmp
2.convert GoodMorning_level.bmp -gravity center -region 1060x1580+300+320 GoodMorning_level.bmp


Thanks & Regards,
Akkisai