如何在 Ubuntu 和其他 Linux 发行版中查看 AVIF 图像
AVIF
![](/data/attachment/album/202306/16/112647uraz4vkzkkvk1mxa.jpg)



> 
> 在 Linux 中无法打开 AVIF 图片？AVIF 是一种新的网络图像文件格式，下面是在 Linux 桌面上查看 AVIF 图像的方法。
> 
> 
> 


就质量而言，PNG 是最好的，但它们体积庞大，因此不适合用于网站。


JPEG 会减小文件大小，但会显着降低图像质量。


WebP 是一种相对较新的格式，可以生成尺寸更小、质量更好的图像。


现在，[AVIF](https://aomediacodec.github.io/av1-avif/) 是一种新的文件格式，可以在不牺牲质量的情况下压缩图像。对于相同的图像质量，它们比 WebP 更小。


最近 [Linux 已开始提供 WebP 支持](https://itsfoss.com/webp-ubuntu-linux/)。但是，许多发行版默认不支持 AVIF 图像格式。


如果你从网络上下载 AVIF 格式的图像，它不会显示缩略图。


![avif image no thumbnail](/data/attachment/album/202306/16/112812duz5mhdhwp5ehhuy.png)


如果你尝试使用默认图像查看器打开它，它很可能会显示“无法识别的图像文件格式”错误。


![avif images dont open linux](/data/attachment/album/202306/16/112812whnxamlngtus5zs2.png)


那么，解决方案是什么？ 在 Linux 上根本看不了 AVIF 图像吗？


不，事实并非如此。对于 Linux，总有一种解决方法。


### 在 Linux 中查看 AVIF 图像文件


有一个名为 gThumb 的便捷 [图像查看器](https://itsfoss.com/image-viewers-linux/)，可用于在 Linux 上打开 AVIF 图像。


如果不是全部的话，它应该在大多数 Linux 发行版的仓库中可用。


在 Ubuntu 和基于 Debian 的发行版上，使用以下命令安装 gThumb。



```
sudo apt install gthumb

```

![install gthumb ubuntu](/data/attachment/album/202306/16/112813ixsaz1hq19a89s16.png)


安装后，选择一张 AVIF 图像，右键单击它并选择“<ruby> 打开方式 <rt>  Open With </rt></ruby>”选项。在这里，选择 gThumb，将其设为 AVIF 图像的默认值并打开它。


![make gthumb default for avif](/data/attachment/album/202306/16/112813gryf7rxcll2klxc8.png)


gThumb 在打开的图像下以缩略图格式显示同一文件夹中的所有图像。


![avif image opened with gthumb in linux](/data/attachment/album/202306/16/112843sma9m9y9fwfawtwy.jpg)


使用 gThumb 打开 AVIF 图像后，它们也应该以缩略图显示。


![avif image thumbnail](/data/attachment/album/202306/16/112814i110w171jbu5s1j8.png)


就是这样。你现在可以在 Linux 桌面上欣赏 AVIF 图像。


### 总结


gThumb 是一个用途极为广泛且功能强大的应用。这让我想知道为什么它不被用作 GNOME 或其他桌面环境和发行版中的默认图像查看器。


关于 Linux 中默认的 AVIF 支持，迟早会添加。目前，gThumb 完成了这项工作。


*（题图：MJ/a54d1f0d-ea92-42dd-bb31-de8097153cad）*




---


via: <https://itsfoss.com/view-avif-images-linux/>


作者：[Abhishek Prakash](https://itsfoss.com/) 选题：[lkxed](https://github.com/lkxed) 译者：[geekpi](https://github.com/geekpi) 校对：[wxy](https://github.com/wxy)


本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译，[Linux中国](https://linux.cn/) 荣誉推出


OK
![Warp Terminal](/assets/images/warp-terminal.webp)


![Warp Terminal](/assets/images/warp-terminal.webp)

PNGs are the best when it comes to quality but they are huge in size and hence not ideal for websites.

JPEGs reduce the file size but they reduce the quality of the images significantly.

WebP is a relatively newer format that produces better-quality images with significantly smaller sizes.

Now, [AVIF](https://aomediacodec.github.io/av1-avif/) is a new file format that compresses images without sacrificing quality. They are smaller than WebP for the same image quality.

[Linux has started providing WebP support](https://itsfoss.com/webp-ubuntu-linux/) recently. However, AVIF image format is not yet supported by default in many distributions.

If you download an image in AVIF format from the web, it won’t display the thumbnail.

![avif image no thumbnail](https://itsfoss.com/content/images/wordpress/2022/10/avif-image-no-thumbnail.png)

And if you try to open it with the default image viewer, it is likely to show ‘unrecognized image file format’ error.

![avif images dont open linux](https://itsfoss.com/content/images/wordpress/2022/10/avif-images-dont-open-linux.png)

So, what’s the solution? Can you not view AVIF images on Linux at all?

Nope, that’s not the case. There is always a workaround when it comes to Linux.

## Viewing AVIF image files in Linux

There is a handy [image viewer](https://itsfoss.com/image-viewers-linux/) called gThumb that can be used for opening AVIF images on Linux.

It should be available in the repositories of most Linux distributions, if not all.

On Ubuntu and Debian-based distributions, use the following command to install gThumb.

`sudo apt install gthumb`


![install gthumb ubuntu](https://itsfoss.com/content/images/wordpress/2022/10/install-gthumb-ubuntu.png)

Once installed, select an AVIF image, right-click on it and select “Open With” option. Here, select gThumb, make it default for AVIF images and open it.

![make gthumb default for avif](https://itsfoss.com/content/images/wordpress/2022/10/make-gthumb-default-for-avif.png)

gThumb shows all the images from the same folder in thumbnail format under the opened image.

![avif image opened with gthumb in linux](https://itsfoss.com/content/images/wordpress/2022/10/avif-image-opened-with-gthumb-in-linux.webp)

Once you open AVIF images with gThumb, they should also be displayed with thumbnails.

![avif image thumbnail](https://itsfoss.com/content/images/wordpress/2022/10/avif-image-thumbnail.png)

That’s it. You can now enjoy AVIF images on your Linux desktop.

## Conclusion

gThumb is an extremely versatile and capable application. It makes me wonder why it is not used as the default image viewer in GNOME or other desktop environments and distributions.

And about default AVIF support in Linux, sooner or later it will be added. For now, gThumb does the job.