DEV Community

Cuelark
Cuelark

Posted on Originally published at Medium

How to Convert WebP to JPG (Windows, Mac, Browser, or Python)

To convert a WebP image to JPG, open it in an app that can read WebP and save or export a copy as JPEG: Paint on Windows, Preview on a Mac, a browser-based converter, or a three-line Python script. The one thing to watch is transparency, because JPG has no alpha channel, so transparent areas have to be filled with a solid color first.

You usually hit this when you right-click an image on a website, save it, and get a .webp file that an upload form, an older Office version or an image editor refuses to take. Here is how to fix it on each platform, plus what you lose along the way.

Why you end up with WebP files

WebP is Google's image format with both lossy and lossless compression. Google's own FAQ says WebP is typically about 30% smaller than JPEG at the same quality, which is why so many sites now serve it. Every current major browser displays it: Chrome, Edge, Firefox, Opera, and Safari 14 or later on iOS 14 and macOS Big Sur (Google WebP FAQ).

The catch is outside the browser. Plenty of forms and desktop apps still accept only JPG and PNG. JPG is still the most widely used format for still photos (MDN image format guide), so converting to JPG is the safest bet for compatibility.

Option 1: Windows (Paint)

Windows reads WebP through Microsoft's free WebP Image Extension, which lets File Explorer, Photos and other Windows apps view WebP images. If double-clicking a .webp file already shows the image, you're set.

  1. Right-click the .webp file and choose Open with > Paint.
  2. Choose File > Save as > JPEG picture.
  3. Pick a name and folder, then click Save.

This works one file at a time, so it's best for a quick one-off.

Option 2: Mac (Preview)

Apple documents the export path in its Preview user guide:

  1. Open the WebP file in Preview.
  2. Choose File > Export.
  3. Set Format to JPEG and use the Quality slider.
  4. Click Save.

To convert several files at once, Apple's tip is to open them all in one Preview window, select them in the sidebar, and then export. If Preview won't open a particular file on an older macOS version, use the browser method below.

Option 3: In the browser, without uploading

If you have a batch of files, or you're on a machine you don't control, a browser-based converter is the fastest route. Make sure it runs the conversion locally, so your images never leave your computer.

Our free WebP to JPG converter works that way. Drop in as many .webp files as you want, adjust the quality slider, and download each JPG or a ZIP of all of them. Transparent areas are filled with white, and a toggle lets you keep or strip photo metadata (date, camera, location). You can check in your browser's network panel that nothing is uploaded while a file converts. One limit: very large images (roughly over 16,000 px on a side) can exceed the browser's canvas limit.

A good alternative is Google Chrome Labs' Squoosh. Its README says it doesn't send your image to a server and does all processing locally (source). Squoosh is built for tuning one image at a time with a before-and-after view, so it's the better choice when you want to fine-tune a single hero image. For dozens of files, a batch tool saves clicks.

Option 4: Python (Pillow), for scripts and bulk jobs

If you're a developer with a folder of WebP files, Pillow handles it. Here's the trap. Pillow writes JPEG files only from L (grayscale), RGB or CMYK data, so a transparent WebP (mode RGBA) fails:

from PIL import Image

Image.open("logo.webp").save("logo.jpg")
# OSError: cannot write mode RGBA as JPEG
Enter fullscreen mode Exit fullscreen mode

The common fix, .convert("RGB"), just throws away the alpha channel. Whatever color sits underneath the transparent pixels shows up. In our test file, that was black. To get a clean result, paste the image onto a white background first:

from pathlib import Path
from PIL import Image

for src in Path("images").glob("*.webp"):
    im = Image.open(src)
    if im.mode in ("RGBA", "LA") or "transparency" in im.info:
        im = im.convert("RGBA")
        bg = Image.new("RGB", im.size, (255, 255, 255))
        bg.paste(im, mask=im.getchannel("A"))
        im = bg
    else:
        im = im.convert("RGB")
    im.save(src.with_suffix(".jpg"), quality=85)
Enter fullscreen mode Exit fullscreen mode

Transparent WebP compared with a JPG where alpha was dropped (black background) and a JPG flattened on white

The same 600×340 logo three ways, made with Pillow 13. The middle version is what you get from .convert("RGB") alone.

Pillow's JPEG quality runs from 0 to 95, defaults to 75, and the docs say to avoid values above 95, because 100 makes files much larger for almost no visible gain. For photos, 80–90 is a sensible range.

Animated WebP is another limit. In our test, Pillow opened a 3-frame animated WebP and the saved JPG held only the first frame. JPG can't store animation, so if you need the motion, convert to GIF or MP4 instead.

What you lose when converting

  • Quality, a little. A lossy WebP is already compressed, and saving it as JPG compresses it a second time. At quality 85–90, the difference is hard to see. If you need an exact copy, export PNG instead.
  • File size, often. JPG is usually bigger than the WebP it came from. Our test logo grew from 6.9 KB (WebP) to 15.6 KB (JPG at quality 85). If the form has a size cap, compress the JPG afterward.
  • Transparency, always. Logos and stickers get a solid background. Use PNG if you need to keep transparency.

Don't just rename the file

Changing photo.webp to photo.jpg doesn't convert anything. The data inside is still WebP. Some apps sniff the real format and open it anyway, but upload validators that check file contents will reject it or break later. Do a real conversion.

FAQ

Is WebP better than JPG?
For the web, usually yes: Google measures WebP at about 30% smaller than JPEG at the same quality, and it supports transparency and animation. JPG wins on compatibility with older software and upload forms.

Will converting WebP to JPG reduce quality?
Slightly, because the image gets re-encoded with lossy compression. At quality 85 or higher, most people can't tell.

How do I convert WebP to JPG without software?
Use a browser-based converter that processes files locally. Nothing to install, and on a good tool, nothing gets uploaded.

Why is my converted JPG black where the image was transparent?
The converter dropped the alpha channel without filling it. Flatten the image onto white (or any color) before saving, as in the Python example above.

Can I convert WebP to JPG on an iPhone or Android phone?
A browser-based converter that runs locally works in mobile browsers too. Very large images may hit the phone's canvas memory limit.

Cuelark Team

Top comments (0)