All posts
WebP to PNG via CLI
Decode WebP to PNG with dwebp, keeping transparency.
Open online converterPackages to install
The webp package includes dwebp, which decodes WebP to PNG and other rasters.
webp
sudo apt-get update
sudo apt-get install -y webpHow to run the command
dwebp reads the WebP and writes PNG to the -o file. This is the inverse of cwebp.
dwebp photo.webp -o photo.pngDockerfile 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 && \
rm -rf /var/lib/apt/lists/*
WORKDIR /work
docker build -t webp-to-png .
docker run --rm -v "$PWD:/work" -w /work webp-to-png \
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.pngdwebp -nofancy photo.webp -o photo.png