• This method uses a '2d' canvas context for pixel manipulation, and can apply a color scale or Y flip to the given image. Unfortunately, canvas always uses premultiplied data, and thus images with low alpha values (or multiplying by a=0) will result in black pixels.

    Parameters

    • image: ImageBitmap | HTMLImageElement | HTMLCanvasElement | OffscreenCanvas
    • color: undefined | Vector4 = undefined
    • flipY: boolean = false
    • maxTextureSize: number = 4096

    Returns Promise<OffscreenCanvasExt>