Three pitfalls when wiring up jSquash
· 2 min read
jSquash packages mozjpeg, libwebp, and oxipng into browser-ready WASM. The API looks simple: init() then encode(). Wiring it in, I hit three pitfalls.
Browser capabilities, interaction details, and engineering notes.
View all tagsjSquash packages mozjpeg, libwebp, and oxipng into browser-ready WASM. The API looks simple: init() then encode(). Wiring it in, I hit three pitfalls.
The laziest image compressor is three lines: createImageBitmap to decode, draw to a canvas, canvas.toBlob('image/webp', 0.75). I built that prototype first, and then found it was nowhere near a "professional compression tool".