All posts
JPEG to PNG via CLI
Re-encode JPEG as PNG with ffmpeg.
Open online converterPackages to install
The ffmpeg package is enough — it reads JPEG and writes PNG.
ffmpeg
sudo apt-get update
sudo apt-get install -y ffmpegHow to run the command
Pass the input JPEG with -i and the output PNG filename. -y overwrites the output without asking.
ffmpeg -y -i photo.jpg 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 \
ffmpeg && \
rm -rf /var/lib/apt/lists/*
WORKDIR /work
docker build -t jpeg-to-png .
docker run --rm -v "$PWD:/work" -w /work jpeg-to-png \
ffmpeg -y -i photo.jpg photo.pngExample commands
Run these locally after installing the packages, or inside the container from the Dockerfile.
ffmpeg -y -i photo.jpg photo.pngffmpeg -y -i photo.jpeg -update 1 photo.png