Constructs a new TrustMark instance.
Optional
use_ecc: boolean = trueuse BCH error correction on the payload, reducing payload size (default)
Optional
secret_len: number = 100The length of the secret.
Optional
encoding_mode: number = TrustMark.encoding.BCH_4The data schema encoding mode to use.
Static
encodingDecodes the watermark of an image from a given URL.
The URL of the image to decode.
A promise that resolves to the decoded watermnark data.
Encodes a secret into an image and returns the stego image and the residual image.
The cover image data.
The secret string to encode.
The watermark strength. Default is 0.4.
Whether to overwrite an existing watermark with random values. Default is false.
The output format. Default is 'bytes'.
A promise that resolves with the encoded data or rejects with an error.
Loads an image from a URL or filesystem and processes it based on the specified type.
The URL or filesystem path of the image to be loaded.
The type of processing to be applied to the image.
A promise that resolves with the processed image.
Processes the input image based on the specified processing type.
The image object containing the tensor source and other properties.
The type of processing to be applied to the image ('decode' or other types).
A promise that resolves with the processed image.
Class representing the TrustMark watermark. This class utilizes ECC (Error Correction Codes) and ONNX models for encoding and decoding.