首页 > 系统相关 >Ubuntu (Linux) 上查看 HEIC 格式的图片 / 显示缩略图

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

时间:2023-04-28 14:08:49浏览次数:52  
标签:convert sudo 缩略图 Ubuntu apt install 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).

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

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


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

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!

标签:convert,sudo,缩略图,Ubuntu,apt,install,Linux,HEIC
From: https://blog.51cto.com/u_15236724/6233983

相关文章

  • Ubuntu 22.04 SSH the RSA key isn't working since upgrading from 20.04
    Ubuntu22.04SSHtheRSAkeyisn'tworkingsinceupgradingfrom20.04UpuntillastweekIwasrunningUbuntu20.04happily,andthenovertheweekenddecidedtobackeverythingupandinstall22.04.I'vehadacoupleofteethingissueswhichI&#......
  • 使用 ChatGPT ,通过自然语言编写 eBPF 程序和追踪 Linux 系统
    eBPF是一项革命性的技术,起源于Linux内核,可以在操作系统的内核中运行沙盒程序。它被用来安全和有效地扩展内核的功能,而不需要改变内核的源代码或加载内核模块。今天,eBPF被广泛用于各类场景:在现代数据中心和云原生环境中,可以提供高性能的网络包处理和负载均衡;以非常低的资源开销,做......
  • VMware Workstation 配置 Linux虚拟机网卡
    目录1.配置VMwareworkstation网卡(1)查看当前电脑上的虚拟网卡(2)虚拟机的三种网卡模式(3)配置VMware网卡模式2.配置虚拟机Linuxens33网卡(1)打开linux终端(2)进入ens33网卡配置文件(3)查看VMware虚拟网卡配置信息(4)修改ens33配置文件(5)检测是否配置成功1.配置VMwareworkstation网卡......
  • Linux安装RabbitMQ
    前言:还是和以前一样,linux安装软件的目录都是data目录 1.这次稍微不一样,不过还是进入data目录,创建RabbitMq目录并进入该目录cd/datamkdirrabbitMqcdrabbitMq 2.上传"erlang-21.1-1.el7.x86_64.rpm"文件和 "rabbitmq-server-3.7.7-1.el7.noarch.rpm"文件到当前......
  • 全网最全Linux 运行jar包的几种方式
    全网最全Linux运行jar包的几种方式原文链接:https://blog.csdn.net/zhangmingyue1226/article/details/127831360一、Linux运行jar包的几种方式方式一:java-jarxxx.jar最常用的启动jar包命令,特点:当前ssh窗口被锁定,可按CTRL+C打断程序运行,或直接关闭窗口,程序退出。方式......
  • Linux common clock framework(3)_实现逻辑分析
    1.前言前面两篇clockframework的分析文章,分别从clockconsumer和clockprovider的角度,介绍了Linuxkernel怎么管理系统的clock资源,以及devicedriver怎么使用clock资源。本文将深入到clockframework的内部,分析相关的实现逻辑。注:本文使用的kernel版本为linux-3.10.29。虽然最......
  • 本地java监控远程Linux服务器-jconsole
    一、配置远程服务器需要监控的服务项目(本文以ps为例)需要监控的ps项目,此项目启动文件为ps.sh,编辑sh文件,找到JAVA_OPTS项,在后面添加JAVA_OPTS="-XX:+UseParallelGC-XX:+UseParallelOldGC$JVM_FLAGS$GC_LOG-Dfile.encoding=UTF-8-DLog4jContextSelector=org.apache.logging.......
  • linux下利用nohup后台运行jar文件包程序
    Linux运行jar包命令如下:方式一: 1.java-jarXXX.jar特点:当前ssh窗口被锁定,可按CTRL+C打断程序运行,或直接关闭窗口,程序退出那如何让窗口不锁定?方式二 1.java-jarXXX.jar&&代表在后台运行。特定:当前ssh窗口不被锁定,但是当窗口关闭时,程序中止运行。继续改......
  • linux CentOS 6.5 中安装与配置JDK-7
    检验系统原版本localhost~]#java-versionjavaversion"1.7.0_24"OpenJDKRuntimeEnvironment(build1.7.0_24-b18)OpenJDKHotSpot(TM)ClientVM(build24.45-b08,mixedmode,sharing)进一步查看JDK信息:......
  • 端口进程查看相关linux命令
    硬盘使用情况df-lh查看内存占用free-mhcat/proc/meminfoMem:内存的使用信息Swap:交换空间的使用信息total:总计物理内存的大小。used:已使用物理内存。free:可用物理内存。shared:多个进程共享的内存总额。buffers/cached:缓存缓冲使用物理内存大小。availabl......