ImageDctHashSearchCriteria class

ImageDctHashSearchCriteria class

Represents a search criteria for finding images in a document.

This search criteria uses DCT based perceptual image hash for calculating image similarity. Learn more: https://docs.groupdocs.com/display/watermarknet/Searching+watermarks

The ImageDctHashSearchCriteria type exposes the following members:

Constructors

Constructor Description
init Initializes a new ImageDctHashSearchCriteria instance with a specified file path.
init Initializes a new ImageDctHashSearchCriteria instance with the provided image stream.

Methods

Method Description
and_ Combines this SearchCriteria with other criteria using the logical AND operator. (inherited from SearchCriteria)
and_search_criteria (inherited from SearchCriteria)
not_ Negates this SearchCriteria. (inherited from SearchCriteria)
or_ Combines this SearchCriteria with other criteria using the logical OR operator. (inherited from SearchCriteria)
or_search_criteria (inherited from SearchCriteria)

Properties

Property Description
max_difference The maximum allowed difference between images. (inherited from ImageSearchCriteria)
pages The list of specific page numbers. (inherited from PageSearchCriteria)

Example

from groupdocs.watermark import Watermarker
from groupdocs.watermark.search.search_criteria import ImageDctHashSearchCriteria

def clear_image_watermark():
    with Watermarker("./watermarked-document.docx") as watermarker:
        criteria = ImageDctHashSearchCriteria("./logo.png")
        criteria.max_difference = 0.9
        possible = watermarker.search(criteria)
        for i in range(len(possible) - 1, -1, -1):
            watermarker.remove(possible[i])
        watermarker.save("./output.docx")

Guides

Task guides that use ImageDctHashSearchCriteria:

See Also