encode.Function.compress - MONOGRID/gainmap-js GitHub Wiki
@monogrid/gainmap-js / encode / compress
Function: compress()
compress(
params
):Promise
<CompressedImage
>
Defined in: src/encode/compress.ts:40
Converts a RAW RGBA image buffer into the provided mimeType
using the provided quality
Parameters
params
Returns
Promise
<CompressedImage
>
Throws
if the browser does not support createImageBitmap
Throws
if the provided source image cannot be decoded
Throws
if the function fails to create a canvas context