Encode the full RGBA contents of a canvas as a PNG or JPEG Blob.
'png' (default): lossless; alpha is preserved.
'jpeg': lossy, typically smaller. JPEG cannot carry alpha — transparent
pixels are composited against a background before encoding. Use PNG if you
need alpha.
Encode the full RGBA contents of a canvas as a PNG or JPEG
Blob.'png'(default): lossless; alpha is preserved.'jpeg': lossy, typically smaller. JPEG cannot carry alpha — transparent pixels are composited against a background before encoding. Use PNG if you need alpha.