How can i remove this watermark...

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
vanhoa

How can i remove this watermark...

Post by vanhoa »

Hello, I have an image like this:

Image

I want to remove the center text (VuiLen.com) since sometimes it makes the comic page harder to read...
With photoshop I can do this by:
1. Hue Composite the original image with an same-size image filled with ED8EEB (237,142,235)
2. Use the Color Dodge Composition for the result image with an same-size image filled with 127114 (18,133,20)
3. Saturation the result image with black (000000)
4. Multiply the result image with itself about 2-5 times
and the result is like this:

Image

How can I do this with imagemagick?
And can you find a better solution? (This method is not good... It remove not only the text but also the light parts of the image...)

Thank you very much,
vanhoa
Last edited by vanhoa on 2009-08-11T11:06:28-07:00, edited 1 time in total.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How can i remove this watermark...

Post by fmw42 »

try this:

convert Untitled3.jpg -colorspace HSB -channel B -separate -channel rgb -white-threshold 75% Untitled3_b_wt75.png

Image
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: How can i remove this watermark...

Post by anthony »

What you really want is to somehow remove just the color parts.

The colors are however added to all three color channels, which makes it much more difficult.

However your steps do not define what 'Hue Composite' does!!! and how it composes with the specific color you describe. Where did you get these steps from?

I look forward to other peoples responses to this problem!



NOTE: once you have the technique down, apply the exact same operators to a HALT: image. You can than very quickly re-apply ALL the color modifications to ANY image using that modified HALT image!
http://www.imagemagick.org/Usage/color/#hald-clut
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
vanhoa

Re: How can i remove this watermark...

Post by vanhoa »

Thank you fmw42, works very well :)

To anthony, I use the word 'Hue Composition' from Photoshop. About the steps... I dont know why I can find it, I opened Photoshop, think about the result, and try the steps I can think up and see the result... But I really dont know how can I obtain them :? Sorry for my bad English
vanhoa

Re: How can i remove this watermark...

Post by vanhoa »

fmw42, your solution has a little prblem with this image

Image
Last edited by vanhoa on 2009-08-11T11:06:57-07:00, edited 1 time in total.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: How can i remove this watermark...

Post by anthony »

I think the best steps would be to first isolate the pixels that are 'colorful'.
then figure out how type of color should be removed.

If the exact same watermark is being used on the exact same sized image, over and over, then on step would be to recover the watermark that was used, in terms of color and transparency.

What that the difference between the water mark and the specific color should be able to be extracted, especially once the 'transparency' is known, so you know how much a specific color is watermark and how much original image.

That is it should be posible to recover a near perfect replica of the original image!!!
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
vanhoa

Re: How can i remove this watermark...

Post by vanhoa »

The wartermark position is not the same in each image...
About the transparency, we can get the level easily by comparing the color at the pink-wartermarked blackest pixel and the pink-wartermarked whitest pixel.
...

Here is the detailed steps in my solutions:

Here is the original (croped) image:
Image Image

Adding a upper layer filled with pink (ED8EEB:237,142,235) and compositing by Hue composition:
Image Image Image

Adding a upper layer filled with green (127114: 18,133,20) and compositing by Color dogle composition:
Image Image Image

Saturation with a upper level black-filled image:

Image Image Image

Flatten the layers, multiply the result image by itself:
Image Image

And it's the final image. Compare it (right) with the original (left):
ImageImage
Last edited by vanhoa on 2009-08-11T11:07:19-07:00, edited 1 time in total.
vanhoa

Re: How can i remove this watermark...

Post by vanhoa »

I've found 2 other solutions:


First:
Image
Layer 1 is the original image with only the blue chanel (subtracted the red chanel and the green chanel).
Layer 2 is the original image, compositing with the layer1 by "Soft Light".
____________________________
Second:
Image
Layer 1 is the original image, applied the "Sharpen edge" filter.
Layer 2 is filled with ED8EEB, compositing method is "Hue".
Layer 3 is filled with 127114, compositing method is "Color dodge".
Layer 4 is filled with 127114, compositing method is "Overlay".
Layer 5 is filled with ED8EEB, compositing method is "Overlay".
Layer 6 is filled with 000000, compositing method is "Saturation".
Last edited by vanhoa on 2009-08-11T11:06:11-07:00, edited 1 time in total.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How can i remove this watermark...

Post by fmw42 »

try post processing your result with my approach (and vary the threshold value if needed)
vanhoa

Re: How can i remove this watermark...

Post by vanhoa »

Hello fmw42, I really new to imagemagick and it seems that I can not write the code myself... Please help me :(
vanhoa

Re: How can i remove this watermark...

Post by vanhoa »

well this works:

Code: Select all

\( +clone -colorspace HSB -channel B -separate -channel rgb -white-threshold 80% \) +swap -channel rgb -compose overlay -composite -colorspace Gray
Image
vanhoa

Re: How can i remove this watermark...

Post by vanhoa »

I've tried to remove the wartermark with php, just recolor the color pixel and here is the result:

Image

8)
Post Reply