Remove Watermark Image Filter
Remove watermark
Starting from Aspose.Imaging graphic library version 23.9, we have introduced a new feature: the Remove Watermark image filter. This filter managed through the WatermarkRemover class, allows you to manipulate watermark signatures on your images or photos.
In the following C# code example, we illustrate how to use this feature. We begin by loading a PNG image that contains a watermark. In this specific case, the watermark is situated within a circular area. To specify the watermark's location on the image, we create a corresponding graphic path. We refer to this path object as a 'mask' and include an ellipse shape in this path. The coordinates for the ellipse inscribed within the rectangle are pre-determined.
After creating the watermark mask with the ellipse shape, we utilize the WatermarkRemover.PaintOver method to process the PNG image using Watermark.Options. Additionally, we employ ContentAwareFillWatermarkOptions and configure the MaxPaintingAttempts property to be 1. This means that the 'Content-Aware Fill' algorithm will make a maximum of one painting attempt and choose the best fill option. It's important to note that more attempts generally yield better results, but they also consume more time. Alternatively, you can opt for the 'Telea' algorithm, which is also available as an option.
C# code example: