The High-Efficiency Image File Format (HEIF) is a new image file format introduced in 2015. It gained traction when it became the default file format on Apple’s iOS 11. Support on other platforms is also growing, e.g. with Android since Version 10.
This new image format allows for much smaller file sizes through advanced, modern compression methods while retaining higher image quality than its JPEG alternative. To be precise, HEIC is the file format name Apple is using for the new HEIF standard.
So it was only a matter of time until people started using HEIC images instead of JPG on their mostly Apple-based computers.
In the past, HEIC images were not supported by Paddy’s Pi3D PictureFrame image viewer but now they are. This article shows you how to enable your Raspberry Pi to display HEIC files.
Tested with: Raspberry Pi OS March 2021 version, Raspberry Pi 2, 3, and 4, Pi3D 2.43, PictureFrame 2021.03.20
The pyheif module
The installation of the pyheif module on the Raspberry Pi is a bit tricky but a number of people on Github that are far cleverer than me have solved this issue for the rest of us. A big Thank You!
I took the liberty of compacting many separate commands in one to save you time and effort.
Here is how to do it. Connect to your Raspberry Pi through ssh in the Terminal.
First, run a system update:
sudo apt update && sudo apt upgrade -y
Copy and paste this command (yes, it’s very long):
sudo apt-get remove libde265-0 -y && sudo apt-get remove libheif1 -y && sudo apt-get remove libheif-dev -y && sudo apt-get remove libde265-dev -y && sudo apt install autotools-dev automake libtool texinfo x265 -y && git clone https://github.com/strukturag/libde265.git && cd libde265 && ./autogen.sh && ./configure --disable-dec265 --disable-sherlock265 --prefix /usr && make && sudo make install && cd .. && git clone https://github.com/strukturag/libheif.git && cd libheif && ./autogen.sh && ./configure --prefix /usr && make && sudo make install && cd .. && git clone https://github.com/libffi/libffi.git && cd libffi && ./autogen.sh && ./configure --prefix /usr && make && sudo make install && cd .. && pip3 install git+https://github.com/carsales/pyheif.git && sudo pip3 install pyheif
Go away and make yourself a cup of coffee because this will run for fifteen minutes on a Raspberry Pi 4, and twice that on a Pi 3.
In the end, you will have three new directories called libde265, libffi and libheif.
HEIC image converters
If instead you just want to convert your HEIC files into good old JPGs, you can use online converters like HEICtoJPEG.
It’s been almost 50 years since the lossy compression technique for the JPG format was invented and almost 30 years after it became a standard in the Joint Photographic Experts Group.
HEIC is unlikely to change this dominance anytime soon but with the strong support by Apple, this new format has a good chance to coexist alongside JPG.
And now that you know how to use it on your Raspberry Pi for your digital picture frame, you can mix JPG and HEIC formatted images as you like.
- How to automatically control the display brightness of your Raspberry Pi photo frame
- How to fully integrate your Raspberry Pi digital picture frame into Home Assistant even showing the current image
- Activate the power of the magic matting feature on your Raspberry Pi picture frame
- How to use your Raspberry Pi digital picture frame in portrait orientation