#### Beyond Linux® From Scratch (systemd Edition) - Version r13.0-491

### Chapter 10. Graphics and Font Libraries

- Prev

  libgxps-0.3.2

- Next

  libjpeg-turbo-3.1.4.1

- Up
- Home

# libheif-1.21.2

## Introduction to libheif

The libheif package is an HEIF and AVIF file format decoder and encoder.

### Note

Development versions of BLFS may not build or run some packages properly if LFS or dependencies have been updated since the most recent stable versions of the books.

### Package Information

- Download (HTTP): https://github.com/strukturag/libheif/releases/download/v1.21.2/libheif-1.21.2.tar.gz

- Download MD5 sum: bee744908edb9d5957cb37fb0b1c6e8f

- Download size: 1.8 MB

- Estimated disk space required: 36 MB (with tests)

- Estimated build time: 1.5 SBU (with tests)

### Additional Downloads

- Required patch: https://www.linuxfromscratch.org/patches/blfs/svn/libheif-1.21.2-svt_av1_build_fix-1.patch

### libheif Dependencies

#### Recommended

libaom-3.13.3, libde265-1.0.18, and x265-4.2

#### Optional

Brotli-1.2.0, dav1d-1.5.3, Doxygen-1.17.0, FFmpeg-8.1, gdk-pixbuf-2.44.6, libjpeg-turbo-3.1.4.1, libpng-1.6.58, libtiff-4.7.1, libwebp-1.6.0, OpenJPEG-2.5.4, sdl2-compat-2.32.68, SVT-AV1-4.1.0, x264-20250815, kvaaar, openh264, openjph, uvg266, vvdec, vvenc, and rav1e

## Installation of libheif

First, fix building libheif if you are going to enable the SVT-AV1 encoder:

    patch -Np1 -i ../libheif-1.21.2-svt_av1_build_fix-1.patch

Install libheif by running the following commands:

    mkdir build &&
    cd    build &&

    cmake -D CMAKE_INSTALL_PREFIX=/usr \
          -D CMAKE_BUILD_TYPE=Release  \
          -D WITH_GDK_PIXBUF=OFF       \
          -D WITH_OpenH264_DECODER=OFF \
          -G Ninja ..                  &&
    ninja

To test the results, issue: ninja test.

Now, as the `root` user:

    ninja install

## Command Explanations

`-D WITH_GDK_PIXBUF=OFF`: This option disables building the gdk-pixbuf loader, as gdk-pixbuf-2.44.6 is supposed to use this package via glycin-2.1.1 instead of the loader.

`-D WITH_DAV1D=ON`: This option allows using dav1d-1.5.3 to decode AV1 data in AVIF files.

`-D WITH_FFMPEG_DECODER=ON`: This option allows using FFmpeg-8.1 to decode H.265 data in HEIC files.

`-D WITH_JPEG_ENCODER=ON -D WITH_JPEG_DECODER=ON`: These options allow using libjpeg-turbo-3.1.4.1 to encode and decode HEIF files with JPEG data.

`-D WITH_OpenJPEG_ENCODER=ON -D WITH_OpenJPEG_DECODER=ON`: These options allow using OpenJPEG-2.5.4 to encode and decode HEIF files with JPEG 2000 data.

`-D WITH_SvtEnc=ON`: This option allows using SVT-AV1-4.1.0 to encode AV1 data for AVIF files.

## Contents

Installed Programs: heif-convert (symlink to heif-dec), heif-dec, heif-enc, heif-info, heif-thumbnailer (if libpng is available), and heif-view (if SDL2 is available)
Installed Library: libheif.so
Installed Directory: /usr/include/libheif, /usr/lib/cmake/libheif, and /usr/lib/cmake/libheif

### Short Descriptions

heif-dec | decodes a HEIC/HEIF image
heif-enc | converts an image to HEIC/HEIF
heif-info | shows information about a HEIC/HEIF file
heif-thumbnailer | creates thumbnails from HEIC/HEIF files
heif-view | displays an image in HEIC/HEIF format with SDL2
`libheif.so` | is an ISO/IEC 23008-12:2017 HEIF and AVIF (AV1 Image File Format) file format decoder and encoder

- Prev

  libgxps-0.3.2

- Next

  libjpeg-turbo-3.1.4.1

- Up
- Home