You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I convert a 3.8 MB JPEG image to PNG, the result is 12.4 MB. It doesn't depend on Q value: the size is the same for both Q = 100 and Q = 30. Here's my worker code:
importVipsfrom'./vendor/vips-es6.js'constvips=awaitVips()onmessage=async({data: { file }})=>{constimage=vips.Image.newFromBuffer(awaitfile.arrayBuffer())// file is an image from input[type="file"]constparams={Q: 30}// changing Q to 100 has no effectconstblob=newBlob([image.writeToBuffer('.png',params)],{type: 'image/png'})image.delete()consturl=URL.createObjectURL(blob)postMessage({ok: true, url,name: file.name})}
I feel like I'm missing something very simple. Plus, wasm-vips supposedly includes libimagequant that is well-known for producing small PNG files.
How do I enable high-quality lossy compression?
The text was updated successfully, but these errors were encountered:
Hi again!
When I convert a 3.8 MB JPEG image to PNG, the result is 12.4 MB. It doesn't depend on Q value: the size is the same for both Q = 100 and Q = 30. Here's my worker code:
I feel like I'm missing something very simple. Plus, wasm-vips supposedly includes libimagequant that is well-known for producing small PNG files.
How do I enable high-quality lossy compression?
The text was updated successfully, but these errors were encountered: