Ubuntu (Linux) 上查看 HEIC 格式的图片 / 显示缩略图

Posted 禅与计算机程序设计艺术

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Ubuntu (Linux) 上查看 HEIC 格式的图片 / 显示缩略图相关的知识,希望对你有一定的参考价值。

Ubuntu 20.04上查看HEIC格式的图片, 仅需要安装一个 heif-gdk-pixbuf 的package, 然后就可以使用 Image Viewer 查看了. 如果还需要在文件管理器中显示缩略图, 那么还需要安装其它2个包(亲测OK):

sudo apt update
sudo apt install heif-gdk-pixbuf
sudo apt install heif-thumbnailer
sudo apt install libheif1:amd64

参考这篇文章. 如果需要把heic格式的图片转换成jpg, 可以参考这篇文章(未验证).




How to view .HEIC photos from iPhone IOS 11+ on Ubuntu?

 image processing - How to view .HEIC photos from iPhone IOS 11+ on Ubuntu? - Ask Ubuntu

HEIC is the file format name Apple has chosen for the new HEIF (High Efficiency Image Format) Standard. Using advanced and modern compression methods, it allows photos to be created in smaller file sizes while retaining a higher image quality compared to JPEG/JPG.

Every ios update comes with a host of changes, but some are not immediately obvious. ... HEIC will be used by default on new photos on iOS 11, and it's designed to save you storage space. As it's a new container format, there will be some incompatibilities along the way, and Apple does a good job at handling most of these.

To view these .HEIC images on Ubuntu, do this...

sudo apt update
sudo apt install heif-gdk-pixbuf
sudo apt install heif-thumbnailer
sudo apt install libheif1:amd64

Then save one of the .HEIC images to your ~/Pictures folder, right-click on the image icon, select Properties, and set the default application to Open With as Image Viewer.

Now a double-click on the image icon will open the file in Image Viewer for viewing.

Image thumbnails will also be seen in Files (Nautilus) windows.

In Thunderbird you can now also view these images in the original email attachment bar.

With Kubuntu, gwenview still would not work. I had to install Image viewer. 

sudo apt-get install gimagereader gpicview

On my system (Ubuntu 20.04), libheif1 was a dependency, and so it was unnecessary for me to install it manually. You can also combine the installation commands into a single command: 

sudo apt install heif-gdk-pixbuf heif-thumbnailer


How to Open iOS HEIC Photos or Convert to JPG/PNG in Ubuntu 20.04 | 22.04

How to Open iOS HEIC Photos or Convert to JPG/PNG in Ubuntu 20.04 | 22.04 | UbuntuHandbook

Got .HEIC photo images import from your iPhone? You may found that Ubuntu does not open the file format out-of-the-box.

It’s however easy to either enable this file format support or convert it to JPG or PNG image.

Enable HEIF/HEIC Support for the Default Image Viewer

In Ubuntu 20.04 and Ubuntu 22.04, you can easily enable the HEIF / HEIC file format support via libheif libraries.

1.) Simply search for and open terminal from system app launcher (or press Ctrl+Alt+T on keyboard).

2.) When terminal opens, run command to install the library:

sudo apt install heif-gdk-pixbuf

Type user password (no asterisk feedback) when it asks and hit Enter

Now, double-click to open the .heic (or right-click -> Open with Other Application -> select Image Viewer) photo and enjoy!

For Ubuntu 18.04 / Ubuntu 16.04 users, the library is not available in system repositories. You have to add the third-party PPA by running command:

sudo add-apt-repository ppa:strukturag/libheif

Then refresh package cache via:

sudo apt update

And finally run the command in step 2.) to get it installed.

Convert HEIF/HEIC to JPEG or PNG

It’s also quite easy to convert the photo to another format in Ubuntu Linux.

Simply open the photo via either GIMP or Krita image editor (both available in Ubuntu Software), then select Export to JPG / PNG.

Too many HEIC photos to convert? Using heif-convert command will be more effective.

1.) Firstly open terminal and run command to install heif-convert tool:

sudo apt install libheif-examples

2.) Next you can convert a HEIC file to JPEG via command:

heif-convert -q 85 input.HEIC output.JPG

Here -q 85 specifies the output quality level. You can skip it to use default value 92.

To batch convert HEIC photos to JPEG, firstly navigate to the photo folder in file manager and select ‘Open in Terminal’ from context menu:

Finally run command:

for file in *.HEIC; do heif-convert $file $file%.HEIC.jpg; done

NOTE: Linux commands are case sensitive! If your HEIC photos have file extension in lower-case, replace HEIC with heic in the last command.

For instance, convert all .HEIC photos to jpg with quality 100%, run command:

for file in *.HEIC; do heif-convert -q 100 $file $file%.HEIC.jpg; done

Updates for Ubuntu 22.04 LTS:

The powerful Imagemagick package in Ubuntu 22.04 repository has support the HEIC/HEIF image format!

First, press Ctrl+Alt+T on keyboard to open terminal and run command to install the tool:

sudo apt install imagemagick

Then, open the folder that contains the photo images, right-click on select “Open in Terminal” and finally use command to convert:

convert input.HEIC -quality 95 output.JPG

Change the number in -quality 95, or skip it to use default 90. To convert a batch of files, use command:

for file in *.png; do convert $file $file%.png.webp; done

That’s all. Enjoy!

以上是关于Ubuntu (Linux) 上查看 HEIC 格式的图片 / 显示缩略图的主要内容,如果未能解决你的问题,请参考以下文章

手机怎么查看heic格式的文件

怎样批量转换jpg格式,电脑如何打开heic?

Heic图片格式怎么查看 如何打开heic文件

Heic图片转换精灵无损转换JPG/PNG/BMP方法

iPhone照片格式heic图片怎么打开

HEIC文件怎么打开,一键批量将HEIC图片转换JPG/PNG/BMP