Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enabled AVIF decoding with libheif #2811

Merged
merged 2 commits into from
Jan 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 2 additions & 3 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,8 @@ NEW or CHANGED MINIMUM dependencies since the last major release are **bold**.
* If you want support for GIF images:
* giflib >= 4.1 (tested through 5.2; 5.0+ is strongly recommended for
stability and thread safety)
* If you want support for HEIF/HEIC images:
* libheif >= 1.3 (tested through 1.9; older versions may also work, we
haven't tested)
* If you want support for HEIF/HEIC or AVIF images:
* libheif >= 1.3 (1.7 required for AVIF support, tested through 1.10)
* If you want support for DDS files:
* libsquish >= 1.13 (tested through 1.15)
* But... if not found on the system, an embedded version will be used.
Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ OpenImageIO consists of:
* Simple but powerful ImageInput and ImageOutput APIs that provide
an abstraction for reading and writing image files of nearly any
format, without the calling application needing to know any of the
details of these file formats, and indeed without the calling
details of these file formats, and indeed without the calling
application needing to be aware of which formats are available.

* A library that manages subclasses of ImageInput and ImageOutput that
Expand All @@ -32,8 +32,8 @@ OpenImageIO consists of:
including TIFF, JPEG/JFIF, OpenEXR, PNG, HDR/RGBE, ICO, BMP, Targa,
JPEG-2000, RMan Zfile, FITS, DDS, Softimage PIC, PNM, DPX, Cineon,
IFF, Field3D, OpenVDB, Ptex, Photoshop PSD, Wavefront RLA, SGI, WebP,
GIF, DICOM, HEIC/HEIF, many "RAW" digital camera formats, and a variety of
movie formats (readable as individual frames). More are being developed
GIF, DICOM, HEIF/HEIC/AVIF, many "RAW" digital camera formats, and a variety
of movie formats (readable as individual frames). More are being developed
all the time.

* Several command line image tools based on these classes, including
Expand Down Expand Up @@ -146,4 +146,3 @@ Mail list subscriptions and archives:
* Developer mail list: http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org

* Just release announcements: http://lists.openimageio.org/listinfo.cgi/oiio-announce-openimageio.org

7 changes: 5 additions & 2 deletions src/cmake/externalpackages.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ if (MSVC)
add_definitions (-DBOOST_ALL_NO_LIB=1)
endif ()
if (LINKSTATIC)
set (Boost_USE_STATIC_LIBS ON)
set (Boost_USE_STATIC_LIBS ON)
else ()
if (MSVC)
add_definitions (-DBOOST_ALL_DYN_LINK=1)
Expand Down Expand Up @@ -163,7 +163,10 @@ checked_find_package (GIF
VERSION_MIN 4
RECOMMEND_MIN 5.0
RECOMMEND_MIN_REASON "for stability and thread safety")
checked_find_package (Libheif VERSION_MIN 1.3) # For HEIF/HEIC format
# For HEIF/HEIC/AVIF formats
checked_find_package (Libheif VERSION_MIN 1.3
RECOMMEND_MIN 1.7
RECOMMEND_MIN_REASON "for AVIF support")
checked_find_package (LibRaw
RECOMMEND_MIN 0.18
RECOMMEND_MIN_REASON "for ACES support and better camera metadata"
Expand Down
17 changes: 9 additions & 8 deletions src/doc/builtinplugins.rst
Original file line number Diff line number Diff line change
Expand Up @@ -568,17 +568,18 @@ preferred except when legacy file access is required.

.. _sec-bundledplugins-heif:

HEIF/HEIC
HEIF/HEIC/AVIF
hjmallon marked this conversation as resolved.
Show resolved Hide resolved
===============================================

HEIF is a container format for images compressed with the HEIC compression
standard (same compression as HEVC/H.265). It is used commonly for iPhone
camera pictures, but it is not Apple-specific and will probably become more
popualar on other platforms in coming years. HEIF files usually use the file
extension :file:`.HEIC`.
HEIF is a container format for images compressed with various compression
standards (HEIC is based on HEVC/H.265, AVIF is based on AV1). HEIC is used
commonly for iPhone camera pictures, but it is not Apple-specific and will
probably become more popular on other platforms in coming years. HEIF files
usually use the file extension :file:`.HEIC` or :file:`.AVIF` depending on their
main compression type.

HEIC compression is lossy, but is higher visual quality than JPEG while
taking only half the file size. Currently, OIIO's HEIF reader supports
HEIC and AVIF compression formats are lossy, but are higher visual quality than
JPEG while taking <= half the file size. Currently, OIIO's HEIF reader supports
reading files as RGB or RGBA, uint8 pixel values. Multi-image files are
currently supported for reading, but not yet writing. All pixel data is
uint8, though we hope to add support for HDR (more than 8 bits) in the
Expand Down
4 changes: 2 additions & 2 deletions src/heif.imageio/heifinput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// This plugin utilises libheif:
// https://github.com/strukturag/libheif
//
// General information about HEIF/HEIC:
// General information about HEIF/HEIC/AVIF:
//
// Sources of sample images:
// https://github.com/nokiatech/heif/tree/gh-pages/content
Expand Down Expand Up @@ -69,7 +69,7 @@ heif_input_imageio_create()
}

OIIO_EXPORT const char* heif_input_extensions[] = { "heic", "heif", "heics",
nullptr };
"avif", nullptr };

OIIO_PLUGIN_EXPORTS_END

Expand Down
Binary file added testsuite/heif/ref/Chimera-AV1-8bit-162.avif
Binary file not shown.
5 changes: 5 additions & 0 deletions testsuite/heif/ref/out-libheif1.9.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,8 @@ ref/IMG_7702_small.heic : 512 x 300, 3 channel, uint8 heif
Exif:SubsecTimeOriginal: "006"
Exif:WhiteBalance: 0 (auto)
oiio:ColorSpace: "sRGB"
Reading ref/Chimera-AV1-8bit-162.avif
ref/Chimera-AV1-8bit-162.avif : 480 x 270, 3 channel, uint8 heif
SHA-1: F8FDAF1BD56A21E3AF99CF8EE7FA45434D2826C7
channel list: R, G, B
oiio:ColorSpace: "sRGB"
2 changes: 1 addition & 1 deletion testsuite/heif/run.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python

imagedir = "ref/"
files = [ "IMG_7702_small.heic" ]
files = [ "IMG_7702_small.heic", "Chimera-AV1-8bit-162.avif" ]
for f in files:
command = command + info_command (os.path.join(imagedir, f))