All posts
WebP to JPEG via CLI
Two steps: dwebp decodes WebP to PNG, ffmpeg encodes JPEG.
Open online converterPackages to install
You need webp (dwebp) and ffmpeg. JPEG has no alpha, so transparency becomes a solid background.
webp
ffmpeg
sudo apt-get update
sudo apt-get install -y webp ffmpegHow to run the command
First dwebp photo.webp -o photo.png, then ffmpeg -y -i photo.png -q:v 2 photo.jpg. Chain them with && if you want.
dwebp photo.webp -o photo.png
ffmpeg -y -i photo.png -q:v 2 photo.jpgDockerfile example
Build a minimal Ubuntu image with the required packages and run the conversion inside the container.
FROM ubuntu:24.04
RUN apt-get update && \
apt-get install -y --no-install-recommends \
webp \
ffmpeg && \
rm -rf /var/lib/apt/lists/*
WORKDIR /work
docker build -t webp-to-jpeg .
docker run --rm -v "$PWD:/work" -w /work webp-to-jpeg \
dwebp photo.webp -o photo.pngExample commands
Run these locally after installing the packages, or inside the container from the Dockerfile.
dwebp photo.webp -o photo.png
ffmpeg -y -i photo.png -q:v 2 photo.jpgdwebp photo.webp -o /tmp/photo.png && ffmpeg -y -i /tmp/photo.png photo.jpeg