How WebP to JPG Conversion Works in Your Browser
WebP wraps compressed image data in a RIFF container, using either the VP8 chunk for lossy frames — a codec with block-based predictive coding inherited from the video world — or VP8L for lossless frames with alpha. This page never touches those bitstreams directly. The file becomes a Blob URL, an HTMLImageElement is pointed at it, and the browser's native WebP decoder expands the compressed stream into a full-resolution bitmap in engine memory, using the same code path that renders WebP images on every website you visit.
From that decoded bitmap the path to JPG is a straight Canvas 2D pipeline. A canvas is allocated at the image's naturalWidth and naturalHeight; an opaque white layer is painted first with ctx.fillStyle = '#ffffff' and a full-canvas fillRect(); and the bitmap is composited on top with drawImage(). The white pass matters because JPEG has no alpha plane — semi-transparent pixels from the WebP's alpha channel blend against white at compositing time rather than being dropped or left undefined. Then canvas.toBlob(..., 'image/jpeg', 0.92) invokes the engine's native baseline JPEG encoder: the RGBA surface is converted to YCbCr, chroma is subsampled 4:2:0, each 8×8 block runs through the forward DCT, coefficients are quantized according to the 92% quality table, and the result is entropy-coded into a standards-compliant JPEG stream.
The pipeline is deliberately single-pass and in-memory. There is no intermediate file, no temp upload, and no server round trip: pixels move from the WebP decoder into the canvas backing store and out of the JPEG encoder into a Blob, which becomes the download. Since both codecs ship inside the browser, the tool carries no codec dependency of its own — which is why it works identically online and off, and why your image data is touched only by code running on your device.