-
-
Notifications
You must be signed in to change notification settings - Fork 308
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
303 changed files
with
23,260 additions
and
8,451 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,9 +15,10 @@ For AVIF, libaom, dav1d, svt-av1, or rav1e are used as codecs. | |
|
||
libheif has support for: | ||
|
||
* HEIC, AVIF, JPEG-in-HEIF, JPEG2000, uncompressed (ISO/IEC 23001-17:2023) | ||
* HEIC, AVIF, VVC, AVC, JPEG-in-HEIF, JPEG2000, uncompressed (ISO/IEC 23001-17:2024) codecs | ||
* alpha channels, depth maps, thumbnails, auxiliary images | ||
* multiple images in a file | ||
* tiled images with decoding individual tiles and encoding tiled images by adding tiles one after another | ||
* HDR images, correct color transform according to embedded color profiles | ||
* image transformations (crop, mirror, rotate), overlay images | ||
* plugin interface to add alternative codecs | ||
|
@@ -26,22 +27,23 @@ libheif has support for: | |
* decoding of files while downloading (e.g. extract image size before file has been completely downloaded) | ||
|
||
Supported codecs: | ||
| Format | Decoders | Encoders | | ||
|:-------------|:-------------------:|:---------------------:| | ||
| HEIC | libde265, ffmpeg | x265, kvazaar | | ||
| AVIF | AOM, dav1d | AOM, rav1e, svt-av1 | | ||
| VVC | vvdec (experimental)| uvg266 (experimental) | | ||
| JPEG | libjpeg(-turbo) | libjpeg(-turbo) | | ||
| JPEG2000 | OpenJPEG | OpenJPEG | | ||
| uncompressed | built-in | built-in | | ||
| Format | Decoders | Encoders | | ||
|:-------------|:-------------------:|:----------------------------:| | ||
| HEIC | libde265, ffmpeg | x265, kvazaar | | ||
| AVIF | AOM, dav1d | AOM, rav1e, svt-av1 | | ||
| VVC | vvdec | vvenc, uvg266 | | ||
| AVC | openh264 | - | | ||
| JPEG | libjpeg(-turbo) | libjpeg(-turbo) | | ||
| JPEG2000 | OpenJPEG | OpenJPEG | | ||
| uncompressed | built-in | built-in | | ||
|
||
## API | ||
|
||
The library has a C API for easy integration and wide language support. | ||
|
||
The decoder automatically supports both HEIF and AVIF through the same API. No changes are required to existing code to support AVIF. | ||
The decoder automatically supports both HEIF and AVIF (and the other compression formats) through the same API. The same code decoding code can be used to decode any of them. | ||
The encoder can be switched between HEIF and AVIF simply by setting `heif_compression_HEVC` or `heif_compression_AV1` | ||
to `heif_context_get_encoder_for_format()`. | ||
to `heif_context_get_encoder_for_format()`, or using any of the other compression formats. | ||
|
||
Loading the primary image in an HEIF file is as easy as this: | ||
|
||
|
@@ -112,6 +114,13 @@ Code using the C++ API is much less verbose than using the C API directly. | |
|
||
There is also an experimental Go API, but this is not stable yet. | ||
|
||
### Reading and Writing Tiled Images | ||
|
||
For very large resolution images, it is not always feasible to process the whole image. | ||
In this case, `libheif` can process the image tile by tile. | ||
See [this tutorial](https://github.com/strukturag/libheif/wiki/Reading-and-Writing-Tiled-Images) on how to use the API for this. | ||
|
||
|
||
## Compiling | ||
|
||
This library uses the CMake build system (the earlier autotools build files have been removed in v1.16.0). | ||
|
@@ -155,22 +164,25 @@ For each codec, there are two configuration variables: | |
* `WITH_{codec}_PLUGIN`: when enabled, the codec is compiled as a separate plugin. | ||
|
||
In order to use dynamic plugins, also make sure that `ENABLE_PLUGIN_LOADING` is enabled. | ||
The placeholder `{codec}` can have these values: `LIBDE265`, `X265`, `AOM_DECODER`, `AOM_ENCODER`, `SvtEnc`, `DAV1D`, `FFMPEG_DECODER`, `JPEG_DECODER`, `JPEG_ENCODER`, `KVAZAAR`, `OpenJPEG_DECODER`, `OpenJPEG_ENCODER`, `OPENJPH_ENCODER`, `UVG266`, `VVDEC`. | ||
The placeholder `{codec}` can have these values: `LIBDE265`, `X265`, `AOM_DECODER`, `AOM_ENCODER`, `SvtEnc`, `DAV1D`, `FFMPEG_DECODER`, `JPEG_DECODER`, `JPEG_ENCODER`, `KVAZAAR`, `OpenJPEG_DECODER`, `OpenJPEG_ENCODER`, `OPENJPH_ENCODER`, `VVDEC`, `VVENC`, `UVG266`. | ||
|
||
Further options are: | ||
|
||
* `WITH_UNCOMPRESSED_CODEC`: enable support for uncompressed images according to ISO/IEC 23001-17:2023. This is *experimental* | ||
and not available as a dynamic plugin. | ||
* `WITH_DEFLATE_HEADER_COMPRESSION`: enables support for compressed metadata. When enabled, it adds a dependency to `zlib`. | ||
* `WITH_UNCOMPRESSED_CODEC`: enable support for uncompressed images according to ISO/IEC 23001-17:2024. This is *experimental* | ||
and not available as a dynamic plugin. When enabled, it adds a dependency to `zlib`, and optionally will use `brotli`. | ||
* `WITH_HEADER_COMPRESSION`: enables support for compressed metadata. When enabled, it adds a dependency to `zlib`. | ||
Note that header compression is not widely supported yet. | ||
* `WITH_LIBSHARPYUV`: enables high-quality YCbCr/RGB color space conversion algorithms (requires `libsharpyuv`, | ||
e.g. from the `third-party` directory). | ||
* `WITH_EXPERIMENTAL_FEATURES`: enables functions that are currently in development and for which the API is not stable yet. | ||
When this is enabled, a header `heif_experimental.h` will be installed that contains this unstable API. | ||
Distributions that rely on a stable API should not enable this. | ||
* `ENABLE_MULTITHREADING_SUPPORT`: can be used to disable any multithreading support, e.g. for embedded platforms. | ||
* `ENABLE_PARALLEL_TILE_DECODING`: when enabled, libheif will decode tiled images in parallel to speed up compilation. | ||
* `PLUGIN_DIRECTORY`: the directory where libheif will search for dynamic plugins when the environment | ||
variable `LIBHEIF_PLUGIN_PATH` is not set. | ||
* `WITH_REDUCED_VISIBILITY`: only export those symbols into the library that are public API. | ||
Has to be turned off for running the tests. | ||
Has to be turned off for running some tests. | ||
|
||
### macOS | ||
|
||
|
@@ -347,6 +359,7 @@ to update the gdk-pixbuf loader database. | |
* [darktable](https://www.darktable.org) | ||
* [digiKam 7.0.0](https://www.digikam.org/) | ||
* [libvips](https://github.com/libvips/libvips) | ||
* [kImageFormats](https://api.kde.org/frameworks/kimageformats/html/index.html) | ||
* [libGD](https://libgd.github.io/) | ||
* [Kodi HEIF image decoder plugin](https://kodi.wiki/view/Add-on:HEIF_image_decoder) | ||
* [bimg](https://github.com/h2non/bimg) | ||
|
@@ -377,5 +390,5 @@ The sample applications are distributed under the terms of the MIT License. | |
See COPYING for more details. | ||
Copyright (c) 2017-2020 Struktur AG</br> | ||
Copyright (c) 2017-2023 Dirk Farin</br> | ||
Copyright (c) 2017-2024 Dirk Farin</br> | ||
Contact: Dirk Farin <[email protected]> |
Oops, something went wrong.