ImageAreaRedaction class

ImageAreaRedaction class

Represents a redaction that places a colored rectangle in a given area of an image document.

Learn more:

The ImageAreaRedaction type exposes the following members:

Constructors

Constructor Description
init Initializes a new ImageAreaRedaction for redacting a specific rectangular area.

Methods

Method Description
apply_to Applies the redaction to a given format instance.
apply_to_document_format_instance

Properties

Property Description
description The description of the redaction, containing its name and parameters.
options The RegionReplacementOptions options with color and area parameters.
top_left The top-left position of the area to remove.

Example

from groupdocs.redaction import Redactor, RedactionStatus
from groupdocs.redaction.redactions import ImageAreaRedaction, RegionReplacementOptions
from groupdocs.pydrawing import Point, Size, Color

point = Point(516, 311)
size = Size(170, 35)
color = Color.from_argb(255, 0, 0, 255)  # blue
options = RegionReplacementOptions(color, size)
redaction = ImageAreaRedaction(point, options)

with Redactor("D:\\test.jpg") as redactor:
    result = redactor.apply(redaction)
    if result.status != RedactionStatus.FAILED:
        redactor.save()

Guides

Task guides that use ImageAreaRedaction:

See Also