@mocanvas/mocanvas · function
declare function downsizeImage(blob: Blob, width: number, height: number, opts?: {
quality?: number;
type?: string;
}): Promise<Blob>Re-encode an image blob at width×height.
Used before an asset is stored, so a 12-megapixel photo does not become a 16 MB data URL in the document. Returns the original blob unchanged where no canvas is available, or where the requested size is not smaller — shrinking is an optimisation, and failing it must not fail the drop.
mocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.