Skip to content

Conversation

@brechtvl
Copy link
Contributor

@brechtvl brechtvl commented Sep 13, 2025

Description

  • Read and write 10 and 12 bit images
  • Read and write CICP

This makes it possible to write HDR images that are much smaller than PNGs, in a file format that is supported in all modern web browsers.

By setting the matrix coefficients, the library will perform RGB to YUV conversion on write. The YUV to RBG conversion was already happening on read automatically.

A future improvement would be a better default choice of matrix coefficients for writing. When no CICP is specified or when CICP is read from PNG, then no conversion to YUV will be performed and compression will not work as well. This is the same behavior as before. When there is support for conversion between CICP and display interop ID, a good default choice for matrix coefficients could be made as part of that.

Tests

Tests for CICP and 10 bit were added.

Checklist:

  • I have read the contribution guidelines.
  • I have updated the documentation, if applicable. (Check if there is no
    need to update the documentation, for example if this is a bug fix that
    doesn't change the API.)
  • I have ensured that the change is tested somewhere in the testsuite
    (adding new test cases if necessary).
  • If I added or modified a C++ API call, I have also amended the
    corresponding Python bindings (and if altering ImageBufAlgo functions, also
    exposed the new functionality as oiiotool options).
  • My code follows the prevailing code style of this project. If I haven't
    already run clang-format before submitting, I definitely will look at the CI
    test that runs clang-format and fix anything that it highlights as being
    nonconforming.

@brechtvl brechtvl marked this pull request as draft September 13, 2025 02:56
@brechtvl
Copy link
Contributor Author

brechtvl commented Sep 13, 2025

Example file: nas_sole_mates.zip

@brechtvl brechtvl force-pushed the heif-cicp branch 3 times, most recently from 8ad4136 to a93a487 Compare September 13, 2025 15:16
By setting the matrix coefficients, the library will perform
RGB to YUV conversion on write. The YUV to RBG conversion was
already happening on read automatically.

Signed-off-by: Brecht Van Lommel <[email protected]>
@brechtvl brechtvl marked this pull request as ready for review September 13, 2025 20:19
@lgritz lgritz added the file formats Image file formats, ImageInput, ImageOutput label Sep 13, 2025
Copy link
Collaborator

@lgritz lgritz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Is this ready to merge?

@brechtvl
Copy link
Contributor Author

Yes, it's ready.

@lgritz lgritz merged commit 40810e2 into AcademySoftwareFoundation:main Sep 14, 2025
58 of 59 checks passed
zachlewis pushed a commit to zachlewis/OpenImageIO that referenced this pull request Sep 16, 2025
…ftwareFoundation#4880)

* Read and write 10 and 12 bit images
* Read and write CICP

This makes it possible to write HDR images that are much smaller than
PNGs, in a file format that is supported in all modern web browsers.

By setting the matrix coefficients, the library will perform RGB to YUV
conversion on write. The YUV to RBG conversion was already happening on
read automatically.

A future improvement would be a better default choice of matrix
coefficients for writing. When no CICP is specified or when CICP is read
from PNG, then no conversion to YUV will be performed and compression
will not work as well. This is the same behavior as before. When there
is support for conversion between CICP and display interop ID, a good
default choice for matrix coefficients could be made as part of that.

Tests for CICP and 10 bit were added.

---------

Signed-off-by: Brecht Van Lommel <[email protected]>
Signed-off-by: Zach Lewis <[email protected]>
lgritz pushed a commit to lgritz/OpenImageIO that referenced this pull request Sep 16, 2025
…ftwareFoundation#4880)

* Read and write 10 and 12 bit images
* Read and write CICP

This makes it possible to write HDR images that are much smaller than
PNGs, in a file format that is supported in all modern web browsers.

By setting the matrix coefficients, the library will perform RGB to YUV
conversion on write. The YUV to RBG conversion was already happening on
read automatically.

A future improvement would be a better default choice of matrix
coefficients for writing. When no CICP is specified or when CICP is read
from PNG, then no conversion to YUV will be performed and compression
will not work as well. This is the same behavior as before. When there
is support for conversion between CICP and display interop ID, a good
default choice for matrix coefficients could be made as part of that.

Tests for CICP and 10 bit were added.

---------

Signed-off-by: Brecht Van Lommel <[email protected]>
lgritz pushed a commit to lgritz/OpenImageIO that referenced this pull request Sep 16, 2025
…ftwareFoundation#4880)

* Read and write 10 and 12 bit images
* Read and write CICP

This makes it possible to write HDR images that are much smaller than
PNGs, in a file format that is supported in all modern web browsers.

By setting the matrix coefficients, the library will perform RGB to YUV
conversion on write. The YUV to RBG conversion was already happening on
read automatically.

A future improvement would be a better default choice of matrix
coefficients for writing. When no CICP is specified or when CICP is read
from PNG, then no conversion to YUV will be performed and compression
will not work as well. This is the same behavior as before. When there
is support for conversion between CICP and display interop ID, a good
default choice for matrix coefficients could be made as part of that.

Tests for CICP and 10 bit were added.

---------

Signed-off-by: Brecht Van Lommel <[email protected]>
lgritz added a commit that referenced this pull request Sep 16, 2025
PR #4880 checked in some output reference that contained version
numbers, which passed in main but failed when backported to 3.1. This
repairs it and makes the output suitable for any version that contains
the patch.

Signed-off-by: Larry Gritz <[email protected]>
lgritz added a commit to lgritz/OpenImageIO that referenced this pull request Sep 16, 2025
PR AcademySoftwareFoundation#4880 checked in some output reference that contained version
numbers, which passed in main but failed when backported to 3.1. This
repairs it and makes the output suitable for any version that contains
the patch.

Signed-off-by: Larry Gritz <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

file formats Image file formats, ImageInput, ImageOutput

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants