WebP, a modern image format developed by Google, offers superior compression for images on the web, often resulting in smaller file sizes without significant loss of quality. While its adoption is widespread in web browsers, native support within Linux desktop environments, particularly Ubuntu, can sometimes be lacking in default applications. Users often encounter messages like "Unrecognized image file format" when attempting to open WebP files with standard image viewers. This guide provides comprehensive solutions for seamlessly handling WebP images on Ubuntu, covering viewing, conversion, and browser-based saving strategies.
Viewing WebP Images Natively in Ubuntu
The default image viewer in Ubuntu, typically GNOME Image Viewer (also known as Eye of GNOME), does not natively support WebP images out of the box. However, several alternative applications offer direct compatibility.
Using gThumb Image Viewer
We highly recommend gThumb, a robust image organizer and viewer that provides built-in WebP support, along with numerous other functionalities like basic editing, color filters, and batch resizing. It's a versatile tool that often exceeds the capabilities of simpler viewers.
To install gThumb on Ubuntu or its derivatives, open your terminal and execute the following commands:
sudo apt update
sudo apt install gthumb
Once installed, gThumb can open WebP images directly. To set gThumb as the default application for WebP files:
- Right-click on any
.webpformat file in your file manager. - From the context menu, select Properties.
- Navigate to the "Open With" tab.
- Select gThumb from the list of applications and click "Set as Default".
Other Compatible Image Viewers
If gThumb doesn't align with your preferences or workflow, consider these alternative applications that support WebP:
- XnView MP: A powerful, cross-platform image viewer and organizer that supports a vast array of formats, including WebP. While not open-source, it is free for personal use and highly feature-rich.
- GIMP (GNU Image Manipulation Program): The professional open-source image editor can be extended to support WebP through a third-party plugin. Installation often involves adding a specific PPA (Personal Package Archive) for your Ubuntu version and then installing the plugin.
- Gwenview: A fast and user-friendly image viewer predominantly used in KDE Plasma desktops. It typically offers good WebP support and can be installed on Ubuntu, although it might pull in additional KDE depandencies.
Converting WebP Images to Other Formats (PNG or JPEG)
Converting WebP images to more widely compatible formats like PNG or JPEG can be accomplished efficiently using both command-line tools and graphical applications.
Command-Line Conversion with webp Utilities
The webp package provides essential command-line utilities for encoding and decoding WebP images. First, ensure these tools are installed on your system:
sudo apt update
sudo apt install webp
After installation, you can use the following commands:
- To convert JPG or PNG to WebP: Use the
cwebpencoder. The-qflag specifies the output quality on a scale of 0 to 100.
cwebp -q 85 input_photo.jpg -o output_image.webp
Or, for a PNG image:
cwebp -q 90 input_graphic.png -o optimized_graphic.webp
- To convert WebP to PNG: Utilize the
dwebpdecoder.
dwebp source_image.webp -o converted_image.png
These command-line tools are particularly advantageous for scripting batch conversions or integrating into automated workflows.
Graphical Interface Conversion with XnConvert
XnConvert is a free, cros-platform batch image converter with a highly intuitive graphical interface. It supports a vast number of formats and offers powerful features like resizing, watermarking, and various filters, in addition to straightforward format conversion.
To convert WebP files using XnConvert:
- Launch XnConvert. In the "Input" tab, add the WebP files or entire folders you wish to convert.
- Navigate to the "Output" tab.
- Specify your desired output directory where the converted files will be saved.
- From the "Format" dropdown menu, select your target image format (e.g., PNG or JPEG).
- Click the "Convert" button to initiate the batch conversion process for all selected files.
Directly Saving WebP Images from Browsers as PNG
For users who frequently download images from the web and prefer to avoid post-download format convertions, browser extensions offer a convenient solution. For Chrome-based browsers (including Chromium, Brave, Microsoft Edge, and Opera), the "Save Image As PNG" extension allows you to download WebP images directly as PNGs, simplifying your workflow.
You can install this extension from the Chrome Web Store: Save Image As PNG
Once the extension is installed, simply right-click on any WebP image within your browser. You will find an option in the context menu specifically to "Save Image As PNG", effectively bypassing the need for separate conversion tools or local file manipulation.