The HEIC/HEIF photo format now works with the Raspberry Pi Pi3D digital picture frame image viewer 2

The HEIC/HEIF photo format now works with the Raspberry Pi Pi3D digital picture frame image viewer

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 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 Dec 2020 version, Raspberry Pi 3 and 4

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 in Pi3D

There isn’t anything more that you need to in Pi3D, just make sure that you have at least version 2.41.

To find out which Pi3D version you have, type

python3 -c 'import pi3d; print(pi3d.__version__)'

If you need to update, here is how.

HEIC image converters

If instead you just want to convert your HEIC files into good old JPGs, you can use online converters like HEICtoJPEG.

Conclusion

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.

Was this post helpful?

Scroll to Top