window.kaolin
    Preparing search index...

    Function blobAlphaChannelFromCanvas

    • Encode just the alpha channel of a canvas as a PNG Blob.

      The encoded image has RGB = 0 everywhere and A = sourceAlpha. Read the alpha channel of the decoded image to recover the mask.

      Parameters

      • canvasOrId: CanvasOrId

        Canvas element or its DOM id.

      Returns Promise<Blob>

      PNG Blob, or null on failure.