How to Save an Image as WebP
Save JPG and PNG images as WebP with Photoshop, GIMP, cwebp, ImageMagick, or a repeatable script. Learn quality, transparency, metadata, and troubleshooting.
WebP is an export format, so the right way to save an image as WebP depends on your workflow. Use Photoshop or GIMP for a graphical workflow, cwebp for a small repeatable command, or ImageMagick when conversion is part of a larger image pipeline. Keep the original until you have inspected the WebP output.
Choose a WebP method
| Method | Best for | Main controls |
|---|---|---|
| Photoshop | Designers already editing in Adobe | Lossless or lossy encoding, quality, metadata |
| GIMP | A free graphical editor | Lossless, quality, alpha, EXIF/IPTC/XMP, color profile |
cwebp |
Scripts and batch conversion | Quality, lossless mode, metadata and encoder settings |
| ImageMagick | Image pipelines and automation | Quality, method, target size, PSNR, alpha compression |
Before exporting
- Keep the source JPG, PNG, or TIFF as your backup.
- Check the required dimensions and whether the destination accepts WebP.
- Decide whether transparency, metadata, or exact pixel fidelity is required.
- For lossy output, plan to compare the result at the size where people will see it.
Save an image as WebP in Photoshop
Photoshop 23.2 and later supports native WebP export. Adobe documents that 8-bit RGB Photoshop documents can be saved in WebP.
- Open the image in Photoshop.
- Choose File > Save a Copy.
- Choose WebP from the Format menu.
- Select lossless or lossy encoding.
- For lossy output, adjust quality and review the preview. Choose metadata options as required.
- Select OK, then open the resulting
.webpfile and inspect it.
See Adobe’s WebP documentation for the Photoshop-specific dialog and supported document conditions.
Photoshop choices
- Lossless: preserves image quality and is useful when pixel accuracy or repeated editing matters. The file is usually larger.
- Lossy: usually produces a smaller file. Increase quality if edges, text, gradients, or transparency show artifacts.
- Metadata: retain only what the destination needs. EXIF, IPTC, XMP, and color-profile requirements vary by workflow.
Save an image as WebP in GIMP
- Open the image in GIMP.
- Choose File > Export As.
- Give the file a
.webpextension and select Export. - In the WebP export dialog, choose Lossless when preserving original quality is required. Leave it unchecked for lossy compression.
- For lossy output, set image quality and alpha quality, then export.
- Enable retention of EXIF, IPTC, XMP, color profile, or thumbnail data only when needed.
The GIMP documentation describes the WebP export options. If the image contains transparency, inspect transparent edges against both light and dark backgrounds.
Convert to WebP with Google’s cwebp
Google’s cwebp utility encodes JPEG, PNG, or TIFF input to WebP. Google provides prebuilt utilities for Windows, Linux, and macOS.
cwebp input.jpg -o output.webp
A quality-controlled lossy conversion:
cwebp -q 80 input.jpg -o output.webp
A lossless conversion:
cwebp -lossless input.png -o output.webp
For a transparent PNG, use lossless mode when exact alpha and pixel values matter, or compare lossy alpha quality carefully. To decode a WebP back to PNG, use Google’s dwebp:
dwebp output.webp -o restored.png
Read the official cwebp reference and precompiled utilities page for installation and encoder flags.
Batch conversion with cwebp
On macOS or Linux, this shell loop converts every JPG in a directory:
mkdir -p webp
for file in images/*.jpg; do
name=$(basename "$file" .jpg)
cwebp -q 80 "$file" -o "webp/$name.webp"
done
For PNG files, change the glob and extension. Quote paths so filenames containing spaces are handled safely.
Convert to WebP with ImageMagick
ImageMagick can read and write WebP when its WebP delegate library is available.
magick input.jpg -quality 80 output.webp
Lossless output:
magick input.png -define webp:lossless=true output.webp
ImageMagick exposes quality, lossless mode, alpha compression, method, target size, target PSNR, and image-type hints. Its documented default quality is 75 and default method is 4. See the ImageMagick WebP documentation.
Verify WebP support before building a pipeline:
magick -version
Look for WebP in the listed delegates. If it is absent, install an ImageMagick build with WebP support or use cwebp.
Lossless or lossy WebP?
| Requirement | Recommended choice |
|---|---|
| Exact pixels, screenshots, diagrams, or archival output | Lossless |
| Small photographs for web delivery | Lossy, then inspect at display size |
| Transparency with sharp edges | Lossless first; compare alpha quality if using lossy |
| Repeated editing | Keep the original and export a lossless derivative |
Google’s WebP FAQ publishes an average claim of 30% more compression than JPEG without loss of image quality. That is a general claim, not a guarantee for every image, so measure your own files.
Check the exported WebP
- Open it in a current browser or image viewer.
- Compare dimensions with the source.
- Test transparent areas on contrasting backgrounds.
- Check color profiles if color accuracy matters.
- Confirm required EXIF, IPTC, or XMP fields remain.
- Compare lossy output at its real display size, especially around text, faces, gradients, and fine lines.
- Record file size before replacing the original.
Save a webpage screenshot as WebP
If the image you need is a webpage capture rather than a local image file, a screenshot API avoids installing and maintaining a browser. ScreenshotNeo returns PNG, JPEG, WebP, or PDF from one GET request and supports full-page capture, element selectors, custom CSS and JavaScript, device presets, retina scale, waiting rules, request blocking, cookies, headers, geolocation, caching, and more.
Or skip the browser setup
Use the ScreenshotNeo API documentation for authentication and options. This request saves a webpage screenshot as WebP:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
Cookie banners, newsletter popups, and chat widgets are removed before the shot. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and the response identifies the result with X-Page-Verdict and X-Billed headers. An MCP server lets Claude, Cursor, and other MCP clients take screenshots with take_screenshot, inspect pages with get_page_info, and create PDFs with capture_pdf. The Free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000 shots. Create a free ScreenshotNeo account.
Troubleshooting
| Problem | Cause | Fix |
|---|---|---|
| WebP is missing from Photoshop’s format list | Older Photoshop version or unsupported document mode | Use Photoshop 23.2 or later and an 8-bit RGB document, or convert with GIMP or cwebp. |
| ImageMagick reports an unsupported format | The WebP delegate is not installed | Install a build with WebP support or use Google’s cwebp utility. |
| Transparent areas become black or white | Alpha settings or viewer behavior changed during export | Try lossless output, inspect on contrasting backgrounds, and verify alpha quality. |
| Output is larger than the original | Lossless encoding, image content, metadata, or unsuitable quality settings | Compare lossy quality at display size, remove unneeded metadata, and retain the source. |
| Text or edges look blocky | Lossy quality is too low | Raise quality or switch to lossless for screenshots, diagrams, and UI images. |
| Colors look different | Color profile was discarded or interpreted differently | Retain the color profile when required and compare in a color-managed viewer. |
| Batch script fails on filenames with spaces | Unquoted shell paths | Quote every input and output path, as in the cwebp loop above. |
Performance, reliability, and cost notes
- For repeated conversions, command-line tools make settings reproducible and avoid manual mistakes.
- Pre-size images before encoding when the destination never needs the source dimensions; this can reduce both processing time and output size.
- Use lossless selectively. Photographs often benefit from lossy compression, while screenshots, logos, diagrams, and text commonly show artifacts sooner.
- Keep originals and make conversion output a separate artifact so you can change quality later.
- When using ScreenshotNeo, choose caching with a TTL for repeated URLs and use async jobs or bulk capture for larger workloads. Only clean shots are billed; failed loads and cache hits cost nothing.
FAQ
Can I rename a JPG to .webp?
No. Renaming changes the filename, not the encoded format. Export or convert the pixels with an editor or encoder.
Does WebP support transparency?
Yes. Preserve and inspect the alpha channel, especially when exporting lossy images.
Should I delete the original after conversion?
Keep it until the WebP has passed visual, metadata, dimension, and destination compatibility checks.
Which tool is best for automation?
Use cwebp for a focused conversion command and ImageMagick when WebP is one step in a broader image pipeline.
Can a WebP be converted back to the original JPEG quality?
Lossless WebP preserves pixels, but a lossy WebP cannot restore details discarded during encoding. Keep the original for future edits.


