Open tomermes opened 8 years ago
Indeed. PNG files just get bigger instead of compression. Tested on Chrome.
in the demo page, the 2.7 mb after process will grow to 3.1 mb, which drives me crazy
PNG needs an option to change its kind to PNG-8, usually good enough for screenshots, which is what I wanted to use this library for.
canvas.toDataURL(type, encoderOptions): encoderOptions only can used to image/jpeg or image/webp. This is illustrated on the MDN. https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toDataURL
The compress function allows choosing mimetype, but when using png the images only get bigger.