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

    Interface TrustmarkInterface

    interface TrustmarkInterface {
        decode(image: Buffer): Promise<string>;
        encode(
            image: Buffer,
            strength: number,
            watermark?: string,
        ): Promise<Buffer<ArrayBufferLike>>;
    }

    Implemented by

    Index

    Methods

    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<ArrayBufferLike>>

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