getCompressedJpegFromCanvas Function
Produce a jpeg compressed to no more than specified bytes and of no less than specified quality.
getCompressedJpegFromCanvas(canvas: HTMLCanvasElement, maxBytes: number = 60000, minCompressionQuality: number = 0.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: 16 April, 2024
Found something wrong, missing, or unclear on this page?
Raise an issue in our repo.