Classe ContentAwareFillWatermarkOptions

Summary: The common Content Aware Fill Algorithm options.

Module: aspose.imaging.watermark.options

Full Name: aspose.imaging.watermark.options.ContentAwareFillWatermarkOptions

Inheritance: WatermarkOptions

Constructors

NameDescription
ContentAwareFillWatermarkOptions(mask)Initialise une nouvelle instance de la classe ContentAwareFillWatermarkOptions.
ContentAwareFillWatermarkOptions(mask)Initialise une nouvelle instance de la classe ContentAwareFillWatermarkOptions.

Properties

NameTypeAccessDescription
graphics_path_maskGraphicsPathr/wObtient ou définit le masque.
interest_areaRectangler/wObtient ou définit la zone où prendre les patches.
maskSystem.Collections.Generic.IEnumerable`1[[Aspose.Imaging.Point]]r/wObtient ou définit le masque.
max_painting_attemptsintr/wObtient ou définit le nombre maximal de tentatives de peinture.
L’algorithme choisira la meilleure variante.
patch_sizeSystem.Byter/wObtient ou définit la taille du patch (doit être impair).

Constructor: ContentAwareFillWatermarkOptions(mask)

 ContentAwareFillWatermarkOptions(mask) 

Initialise une nouvelle instance de la classe ContentAwareFillWatermarkOptions.

Parameters:

ParamètreTypeDescription
maskPoint[]Le masque pour la zone inconnue.

Constructor: ContentAwareFillWatermarkOptions(mask)

 ContentAwareFillWatermarkOptions(mask) 

Initialise une nouvelle instance de la classe ContentAwareFillWatermarkOptions.

Parameters:

ParamètreTypeDescription
maskGraphicsPathLe masque pour la zone inconnue.

Property: max_painting_attempts

Obtient ou définit le nombre maximal de tentatives de peinture.
L’algorithme choisira la meilleure variante.

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)