getCompressedJpegFromCanvas Function
Produce a jpeg compressed to no more than specified bytes and of no less than specified quality.
getCompressedJpegFromCanvas(canvas: HTMLCanvasElement, maxBytes: number60000, minCompressionQuality: number0.1): string | undefined
@returns A data URL for the image, or undefined
if the compression and size constraints could not be met.
Returns - string | undefined
A data URL for the image, or undefined
if the compression and size constraints could not be met.
Defined in
Last Updated: 17 December, 2024
Found something wrong, missing, or unclear on this page?Raise an issue in our repo.