removeWatermark

removeWatermark ( string orignalImage , string _destinationImage , array _minThresholdWatermark , array _maxThresholdWatermark , boolean _isHSV , int _radiusNeighboringPixels ) : void

Allows you to remove the watermark from an image.
The color area of the watermark is defined by an interval of values in order to create a mask that is replaced by a content calculated by an artificial intelligence.
The result is usually convincing but you need to do some tests to set the values properly and check the final result.

Note: With artificial intelligence image processing functions, be sure to protect your functions from very large images as this processing would then take a long time. To do this use resizeImage.

Example

removeWatermark(path("desktop")+"input.png",path("desktop")+"test.png")


See also

removeTags
ftpUpload

Parameters

orignalImage

Path of the original image with a watermark

_destinationImage (optional)

Path of the destination image (without watermark). If none, it it the same than the original image and it will erase it.

_minThresholdWatermark (optional)

default:[0,0,0] (min of gray in RGB). Define here the minimum RGB colors or HSV tones that will identify the colorimetric range of the watermark. To identify them, go to a photo editing program (Photoshop for example) and use the eyedropper on the light and dark pixels of the watermark. You will then be able to define your intervention range.

_maxThresholdWatermark (optional)

default:[192,192,192] (max of gray in RGB). Define here the maximum RGB colors or HSV tones that will identify the colorimetric range of the watermark. To identify them, go to a photo editing program (Photoshop for example) and use the eyedropper on the light and dark pixels of the watermark. You will then be able to define your intervention range.

_isHSV (optional)

default:false. You can choose to work with the RGB (Red, Green, Blue) or HSV (Saturation, Hue, Lightness) system.

_radiusNeighboringPixels (optional)

default:5. Allows to extend the watermark area around it according to a chosen radius in pixels.