ContentAwareFillWatermarkOptions Clase

Summary: The common Content Aware Fill Algorithm options.

Module: aspose.imaging.watermark.options

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

Inheritance: WatermarkOptions

Constructors

NameDescripción
ContentAwareFillWatermarkOptions(mask)Inicializa una nueva instancia de la clase ContentAwareFillWatermarkOptions.
ContentAwareFillWatermarkOptions(mask)Inicializa una nueva instancia de la clase ContentAwareFillWatermarkOptions.

Properties

NameTypeAccessDescripción
graphics_path_maskGraphicsPathr/wObtiene o establece la máscara.
interest_areaRectangler/wObtiene o establece el área para tomar parches.
maskSystem.Collections.Generic.IEnumerable`1[[Aspose.Imaging.Point]]r/wObtiene o establece la máscara.
max_painting_attemptsintr/wObtiene o establece el número máximo de intentos de pintura.
El algoritmo elegirá la mejor variante.
patch_sizeSystem.Byter/wObtiene o establece el tamaño del parche (debe ser impar).

Constructor: ContentAwareFillWatermarkOptions(mask)

 ContentAwareFillWatermarkOptions(mask) 

Inicializa una nueva instancia de la clase ContentAwareFillWatermarkOptions.

Parameters:

ParámetroTipoDescripción
maskPoint[]La máscara para el área desconocida.

Constructor: ContentAwareFillWatermarkOptions(mask)

 ContentAwareFillWatermarkOptions(mask) 

Inicializa una nueva instancia de la clase ContentAwareFillWatermarkOptions.

Parameters:

ParámetroTipoDescripción
maskGraphicsPathLa máscara para el área desconocida.

Property: max_painting_attempts

Obtiene o establece el número máximo de intentos de pintura.
El algoritmo elegirá la mejor 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)