Last week I needed to convert 200 WebP images to PNG for a print project. My first instinct: convert *.webp *.png with ImageMagick. It worked for 160 of them. The other 40? "Unsupported format."
The WebP Container Is Different
JPEG and PNG are self-describing. WebP uses RIFF — the same container as WAV audio files. The first four bytes are 52 49 46 46 ("RIFF"). Some WebP encoders produce files with non-standard chunk ordering that older libwebp versions can't handle. Chrome's decoder handles everything.
Why Browser-Based Conversion Wins
The browser's Canvas API decodes WebP to raw pixels, then re-encodes as PNG. If the WebP was lossless, PNG output is pixel-identical. If lossy, artifacts are baked in.
I now use webp2png.io for batch conversions — it runs Chrome's decoder in your browser, handles every WebP variant.
async function webpToPng(webpBlob) {
const img = await createImageBitmap(webpBlob);
const canvas = new OffscreenCanvas(img.width, img.height);
canvas.getContext('2d').drawImage(img, 0, 0);
return canvas.convertToBlob({ type: 'image/png' });
}
WebP to PNG isn't a format conversion. It's decode → re-encode.
Top comments (1)
This is great! I'm curious if