ContentAwareFillWatermarkOptions Class
Contents
[
Hide
]Summary: The common Content Aware Fill Algorithm options.
Module: aspose.imaging.watermark.options
Full Name: aspose.imaging.watermark.options.ContentAwareFillWatermarkOptions
Inheritance: WatermarkOptions
Constructors
Name | Description |
---|---|
ContentAwareFillWatermarkOptions(mask) | Initializes a new instance of the ContentAwareFillWatermarkOptions class. |
ContentAwareFillWatermarkOptions(mask) | Initializes a new instance of the ContentAwareFillWatermarkOptions class. |
Properties
Name | Type | Access | Description |
---|---|---|---|
graphics_path_mask | GraphicsPath | r/w | Gets or sets the mask. |
interest_area | Rectangle | r/w | Gets or sets the area to take patches. |
mask | iter[Point] | r/w | Gets or sets the mask. |
max_painting_attempts | int | r/w | Gets or sets the maximum number of painting attempts. The algorithm will chose the best variant. |
patch_size | byte | r/w | Gets or sets the patch size (should be odd). |
Constructor: ContentAwareFillWatermarkOptions(mask)
ContentAwareFillWatermarkOptions(mask)
Initializes a new instance of the ContentAwareFillWatermarkOptions class.
Parameters:
Parameter | Type | Description |
---|---|---|
mask | Point[] | The mask for the unknown area. |
Constructor: ContentAwareFillWatermarkOptions(mask)
ContentAwareFillWatermarkOptions(mask)
Initializes a new instance of the ContentAwareFillWatermarkOptions class.
Parameters:
Parameter | Type | Description |
---|---|---|
mask | GraphicsPath | The mask for the unknown area. |
Property: max_painting_attempts
Gets or sets the maximum number of painting attempts.
The algorithm will chose the best variant.
See also:
Example # 1: The example shows how to remove any object from the image using Graphics Path…
Examples
The example shows how to remove any object from the image using Graphics Path with Content Aware fill algorithm.
from aspose.imaging import Image, Figure, GraphicsPath, RectangleF
from aspose.imaging.shapes import EllipseShape
from aspose.imaging.watermark import WatermarkRemover
from aspose.imaging.watermark.options import ContentAwareFillWatermarkOptions
from aspose.imaging.fileformats.png import PngImage
import aspose.pycore import as_of
image_file_path = "ball.png";
with Image.load(image_file_path) as image:
pngImage = as_of(image, PngImage)
mask = GraphicsPath()
firstFigure = Figure()
firstFigure.add_shape(EllipseShape(RectangleF(350, 170, 570 - 350, 400 - 170)))
mask.add_figure(firstFigure)
options = ContentAwareFillWatermarkOptions(mask)
options.max_painting_attempts = 4
with WatermarkRemover.paint_over(pngImage, options) as result:
result.save(outputPath)