The WebP format, developed by Google, has become the standard for web images in 2026. It offers superior compression (30-50% smaller size) without sacrificing visual quality, resulting in faster websites and better SEO rankings.

In this comprehensive guide, you'll learn how to convert your images to WebP on any operating system.

Why Migrate to WebP?

Before diving into the "how", let's look at the "why":

  • Reduced size: Up to 50% lighter than JPEG and PNG
  • Better quality: More efficient compression algorithm
  • Universal support: Chrome, Firefox, Safari, Edge (all since 2020)
  • Improved SEO: Google PageSpeed Insights actively recommends it
  • Transparency and animation: Supports both alpha channel and animated GIFs

Conversion on Windows

Method 1: Google WebP Codec (Official)

  1. Download the official Google tools: https://developers.google.com/speed/webp/download
  2. Extract the ZIP file (contains cwebp.exe)
  3. Open CMD or PowerShell in the image folder
  4. Execute:
cwebp -q 80 image.jpg -o image.webp

Useful parameters:

  • -q 80: Quality (0-100, recommended 75-85)
  • -lossless: Lossless conversion
  • -resize 1920 0: Resize maintaining aspect ratio

Method 2: XnConvert (Graphical Interface)

  1. Download XnConvert (free): https://www.xnview.com/en/xnconvert/
  2. Add your images (supports batch processing)
  3. In "Output", select WebP format
  4. Adjust quality and convert

Advantage: Convert hundreds of images at once with preview.

Method 3: GIMP or Photoshop

GIMP (free):

  • Open the image → File → Export as → choose .webp
  • Adjust quality in the dialog

Photoshop (2023+):

Conversion on Linux

Method 1: Command Line (cwebp)

Install WebP tools:

# Debian/Ubuntu
sudo apt install webp

# Fedora/RHEL
sudo dnf install libwebp-tools

# Arch
sudo pacman -S libwebp

Basic conversion:

cwebp -q 85 image.jpg -o image.webp

Batch conversion (bash script):

#!/bin/bash
for img in *.jpg; do
    cwebp -q 85 "$img" -o "${img%.jpg}.webp"
done

Method 2: ImageMagick

If you already have ImageMagick installed:

convert image.jpg -quality 85 image.webp

# Batch conversion
mogrify -format webp -quality 85 *.jpg

Method 3: GIMP (Linux)

Just like on Windows, GIMP on Linux natively supports WebP in recent versions.

Conversion on Mac

Method 1: Homebrew + cwebp

# Install Homebrew if you don't have it
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# Install webp
brew install webp

# Convert
cwebp -q 85 image.jpg -o image.webp

Method 2: Automator (Graphical Interface)

Create a quick action in Automator:

  1. Open Automator → New Quick Action
  2. Add "Run Shell Script"
  3. Paste this script:
for f in "$@"
do
    /usr/local/bin/cwebp -q 85 "$f" -o "${f%.*}.webp"
done
  1. Save as "Convert to WebP"
  2. Now you can right-click on images → Services → Convert to WebP

Method 3: Third-Party Apps

Online Tools (No Installation)

If you prefer not to install anything:

  1. Squoosh.app (Google): https://squoosh.app/
    • Side-by-side visual comparison
    • Precise quality control
    • Privacy: conversion in the browser
  2. CloudConvert: https://cloudconvert.com/jpg-to-webp
    • Batch conversion
    • Supports many formats
  3. FreeConvert: https://www.freeconvert.com/webp-converter
    • Up to 1GB per file free

Important: With online tools, your images are uploaded to external servers.

Automation in WordPress

WebP Express Plugin (Recommended)

  1. Install from WordPress repository
  2. Settings → WebP Express
  3. Conversion method: "Imagick" or "cwebp"
  4. Activate "Alter HTML" to serve WebP automatically
  5. Convert existing images with "Bulk Convert"

Imagify or ShortPixel Plugin

Both offer:

  • Automatic conversion on upload
  • Additional optimization
  • Limited free plans

Via .htaccess (Advanced)

If you prefer to serve WebP manually with fallback:

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteCond %{HTTP_ACCEPT} image/webp
  RewriteCond %{REQUEST_FILENAME} (.*)\.(jpe?g|png)$
  RewriteCond %1.webp -f
  RewriteRule (.+)\.(jpe?g|png)$ $1.webp [T=image/webp,E=accept:1]
</IfModule>

<IfModule mod_headers.c>
  Header append Vary Accept env=REDIRECT_accept
</IfModule>

AddType image/webp .webp

Scripts for Batch Conversion

Bash (Linux/Mac)

Convert all JPGs in a folder while maintaining structure:

#!/bin/bash
find . -type f \( -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.png" \) | while read img; do
    output="${img%.*}.webp"
    if [ ! -f "$output" ]; then
        cwebp -q 85 "$img" -o "$output"
        echo "Converted: $img"
    fi
done

PowerShell (Windows)

Get-ChildItem -Filter *.jpg | ForEach-Object {
    $output = $_.BaseName + ".webp"
    & "C:\path\to\cwebp.exe" -q 85 $_.FullName -o $output
}

Python (Cross-platform)

from PIL import Image
import os

for filename in os.listdir('.'):
    if filename.endswith(('.jpg', '.jpeg', '.png')):
        img = Image.open(filename)
        webp_name = os.path.splitext(filename)[0] + '.webp'
        img.save(webp_name, 'webp', quality=85)
        print(f'Converted: {filename} → {webp_name}')

Requires: pip install Pillow

Quality and Size Comparison

Based on tests with typical web images:

Original FormatSizeWebP (q=85)Savings
JPEG (high quality)850 KB420 KB50%
PNG-24 with transparency1.2 MB580 KB52%
PNG-8 (256 colors)180 KB95 KB47%

Recommended quality:

  • -q 85: Perfect balance quality/size (general use)
  • -q 75: More compression, still excellent quality
  • -q 90-100: For professional photography
  • -lossless: For graphics with text, logos

Compatibility and Fallbacks

Browser Support (2026)

✅ Support WebP:

  • Chrome/Edge (since 2010/2018)
  • Firefox (since 2019)
  • Safari (since 2020)
  • Opera (since 2011)

❌ Don't support:

  • Internet Explorer (discontinued)
  • Some very old browsers (<1% of web traffic)

Implementing Fallback in HTML

<picture>
  <source srcset="image.webp" type="image/webp">
  <source srcset="image.jpg" type="image/jpeg">
  <img src="image.jpg" alt="Description">
</picture>

The browser loads WebP if compatible, otherwise uses JPG.

Tips and Best Practices

✅ Recommendations:

  • Keep originals: Always save source images (JPG/PNG)
  • Test different qualities: q=85 is a good starting point
  • Use lossless only when necessary: Logos, diagrams, text
  • Combine with lazy loading: Load images only when visible
  • Optimize before converting: Resize to final size before WebP
  • Verify with PageSpeed Insights: Confirm actual improvement

❌ Avoid:

  • Converting already heavily compressed images (low-quality GIFs)
  • Using q=100 unnecessarily (very large file)
  • Deleting originals immediately

Validation Tools

After converting, verify the results:

  1. PageSpeed Insights: https://pagespeed.web.dev/
  2. GTmetrix: https://gtmetrix.com/
  3. WebPageTest: https://www.webpagetest.org/

Compare size and load time before/after.

Conclusion

In 2026, WebP is the standard format for web images. With the right tools, conversion is simple on any operating system:

  • Windows: XnConvert for GUI, cwebp for CLI
  • Linux: cwebp or ImageMagick, ideal for scripts
  • Mac: Homebrew + cwebp or Automator
  • WordPress: WebP Express for total automation
  • Online: Squoosh.app for quick conversions

The initial time investment is quickly recovered with faster sites, better SEO, and more satisfied users.

What method do you use to convert to WebP? Share your experience in the comments.


# Debian, Django, Linux, Programming, Python, Web, Web Development, Wordpress


To leave a comment you must be logged in:

Sign IN

Comments: (0)

There are no comments yet.