meo-skia-canvas
    Preparing search index...

    Interface ImageDataExportSettings

    How to rasterize a canvas region when reading its pixels out.

    interface ImageDataExportSettings {
        colorSpace?: ColorSpace;
        colorType?: ColorType;
        density?: number;
        matte?: string;
        msaa?: number | boolean;
    }
    Index
    colorSpace?: ColorSpace

    Color space the pixels are converted to on the way out, defaulting to the canvas's own.

    A browser makes the same distinction: getImageData() on a display-p3 canvas hands back P3 components, and the ImageData returned reports the space through its own colorSpace. The same red reads as 255,0,0 in sRGB and 234,51,35 in display-p3.

    colorType?: ColorType

    Pixel format the export is handed back in, defaulting to the canvas's own.

    This is what makes toBuffer("raw", {colorType: "RGBAF32"}) differ from the canvas it came from. Compositing still follows the canvas: a readback format has no business choosing the precision a page is drawn at.

    density?: number

    Number of pixels per grid ‘point’ (defaults to 1)

    matte?: string

    Background color to draw beneath transparent parts of the canvas

    msaa?: number | boolean

    Number of samples used for antialiasing each pixel. 0 and 1 both mean one sample a pixel -- no multisampling.