WebP to JPG Conversion in Ubuntu | Generated by AI
You have several excellent options for converting WebP to JPG in Ubuntu, both from the command line and with GUI tools.
Command Line Tools
These are generally the most flexible and efficient for single files or batch conversions.
1. ImageMagick
ImageMagick is a powerful suite of command-line tools for image manipulation, and it’s widely available.
- Installation:
sudo apt update sudo apt install imagemagick - Convert a single file:
convert input.webp output.jpgOr, using
magickfor ImageMagick v7+:magick input.webp output.jpg - Convert multiple files (batch conversion) in the current directory:
mogrify -format JPEG *.webpThis will convert all
.webpfiles in the current directory to.jpeg(or.jpg) with the same filename. If you want the converted files in a separate directory:mkdir output_jpgs # Create a directory for output mogrify -format JPEG -path output_jpgs *.webp
2. dwebp (from libwebp package)
dwebp is a dedicated tool for decoding WebP images.
- Installation:
sudo apt update sudo apt install webp - Convert a single file:
dwebp input.webp -o output.jpgWhile you specify
.jpgas the output,dwebpoften outputs to PPM format and requires another tool like ImageMagick to convert to a proper JPEG. However, some sources suggest directly using.jpgas the output works for simple cases. If you encounter issues, convert to PNG first, then to JPG:dwebp input.webp -o output.png convert output.png output.jpg
3. ffmpeg
ffmpeg is primarily for video and audio, but it’s also very capable with image formats.
- Installation:
sudo apt update sudo apt install ffmpeg - Convert a single file:
ffmpeg -i input.webp output.jpg - Convert multiple files (batch conversion):
for file in *.webp; do ffmpeg -i "$file" "${file%.*}.jpg"; doneThis command iterates through all
.webpfiles in the current directory and converts them to.jpgwith the same name (e.g.,image.webpbecomesimage.jpg).
GUI Tools
If you prefer a graphical interface, here are a couple of options:
1. GIMP (GNU Image Manipulation Program)
GIMP is a powerful open-source image editor that supports WebP.
- Installation:
sudo apt update sudo apt install gimp - How to convert:
- Open the WebP image in GIMP (File > Open).
- Go to File > Export As.
- In the “Export Image” dialog, choose “JPEG image” from the “Select File Type (By Extension)” dropdown.
- Click “Export” and adjust quality settings if desired.
2. XnView MP / XnConvert
These are cross-platform image viewers and batch converters with comprehensive format support, including WebP.
- Installation:
You might need to download the
.debpackage from their official website and install it usingsudo dpkg -i <package_name.deb>or through a graphical package installer. - How to convert (generally):
- Open XnView MP or XnConvert.
- Add the WebP images you want to convert.
- Choose JPG as the output format.
- Adjust any settings (quality, resize, etc.).
- Start the conversion.
3. Converseen
Converseen is a free batch image converter that supports WebP.
- Installation: You can usually find it in the Ubuntu Software Center or install it via apt if available in your repositories.
- How to convert: It has a straightforward GUI for adding images, selecting output format, and converting.
Which method to choose?
- For quick, single-file conversions or scripting automated tasks: Use
ffmpegorImageMagickfrom the command line. They are very efficient. - For occasional conversions where you want a visual interface and more control over image editing: GIMP is a great choice.
- For batch converting many images with a GUI and various options: XnView MP/XnConvert or Converseen are excellent.
No matter which method you choose, make sure to install the necessary packages first.