@contentauth/c2pa-node 0.12.3
    Preparing search index...

    Class Trustmark

    Implements

    Index

    Constructors

    Methods

    • Decode a watermark from an image.

      Parameters

      • image: Buffer

        image to extract the watermark from (must be in a supported image format like JPEG, PNG, etc.)

      Returns Promise<string>

    • Encode a watermark into an image.

      Parameters

      • image: Buffer

        image to be watermarked

      • strength: number

        number between 0 and 1 indicating how strongly the watermark should be applied

      • Optionalwatermark: string

        optional bitstring to be encoded, automatically generated if not provided

      Returns Promise<Buffer>

      raw pixel data in RGB8 format (width * height * 3 bytes)

    • Remove a P/Q watermark from an 8-bit JPEG or PNG, returning an encoded PNG with the same dimensions and alpha. Requires loadRemover: true. Removal is lossy and does not guarantee restoration of the original pixels. Input is limited to 64 MiB, 16,384 pixels per dimension, and 32 million pixels, with a best-effort 128 MiB decoder allocation budget. Limits are per call, not a cap on total process memory. Image metadata (EXIF, XMP, ICC profiles, and C2PA manifests) is not copied. Existing credentials do not remain valid for the modified pixels; sign a new manifest to attach valid Content Credentials to the output.

      Parameters

      • image: Buffer

      Returns Promise<Buffer>