What this tool does
PNG to WebP decodes one PNG and encodes WebP in the browser. Output is {base}.webp. It inspects a downscaled sample (up to 512×512) to report whether any alpha channel value is below 255.
When to choose it instead of a similar DevToolKit tool
- Use this when the file is PNG and you want a dedicated WebP export with max-dimension downscale.
- Use Image Converter if the source is JPEG/WebP/AVIF, you need JPEG/PNG/AVIF out, or you need exact pixel size or a JPEG matte.
- Use Image Compressor if you want compression presets that can also emit JPEG or PNG.
Typical jobs this page is built for
- Turn a PNG screenshot or UI asset into {base}.webp.
- Use Smaller file (q60) for thumbnails, or High quality (q92) for logos.
- Cap max width/height so a large PNG is downscaled before WebP encode.
Supported inputs, limits, and output behavior
- Input
- One image/png or .png file, 20 MB.
- Output
- {base}.webp
- Quality
- 40–100. Default Balanced 80.
- Resize
- Optional max width/height; ratio = min(widthRatio, heightRatio, 1).
How the transformation actually works
isPngFile checks type or .png name. canvas.toDataURL("image/webp") must succeed or the run fails with WEBP_UNSUPPORTED. Encoding uses toBlob image/webp at quality/100. detectTransparency samples drawn pixels for alpha < 255.
Step-by-step workflow
- Upload a PNG.
- Pick a quality preset or the slider.
- Optionally cap max width and/or max height.
- Click Convert to WebP.
- Compare on the before/after slider.
- Download {base}.webp if you need the file again.
What can change in the output
WebP is a new lossy (or browser-default) encoding of the canvas. Metadata is not copied. Output can be larger than a highly optimized PNG.
Known limitations and failure cases
- Non-PNG files are rejected.
- Browsers without WebP canvas export fail.
- Animated PNG is not a separate path; the Image decoder supplies the frame it loads.
Privacy / where data goes
Conversion stays in the browser. The PNG is not uploaded for this workflow. Identified analytics may include byte counts, dimensions, and quality, not the image pixels.
Practical output-review checklist
- Check semi-transparent edges.
- Open the WebP where you plan to use it.
- Try a lower quality if the file did not shrink; calculateSavings only reports a reduction when output bytes are smaller.
- Keep the PNG if you still need a lossless source.