Penpot plugins API
    Preparing search index...

    Type Alias ImageData

    Represents image data in Penpot. This includes properties for defining the image's dimensions, metadata, and aspect ratio handling.

    type ImageData = {
        name?: string;
        width: number;
        height: number;
        mtype?: string;
        id: string;
        keepAspectRatio?: boolean;
        data(): Promise<Uint8Array<ArrayBufferLike>>;
    }
    Index

    Properties

    name?: string

    The optional name of the image.

    width: number

    The width of the image.

    height: number

    The height of the image.

    mtype?: string

    The optional media type of the image (e.g., 'image/png', 'image/jpeg').

    id: string

    The unique identifier for the image.

    keepAspectRatio?: boolean

    Whether to keep the aspect ratio of the image when resizing. Defaults to false if omitted.

    Methods

    • Returns the imaged data as a byte array.

      Returns Promise<Uint8Array<ArrayBufferLike>>