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

feat(jpeg): Support reading Ultra HDR images #4484

Merged
merged 18 commits into from
Nov 6, 2024

Conversation

mugulmd
Copy link
Contributor

@mugulmd mugulmd commented Oct 8, 2024

Description

Initial feature request: #4424

Add support in the jpeg plugin for reading Ultra HDR images using the reference codec libultrahdr: https://github.com/google/libultrahdr

Tests

Images used for testing during development: https://github.com/MishaalRahmanGH/Ultra_HDR_Samples

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.

Copy link

linux-foundation-easycla bot commented Oct 8, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

src/jpeg.imageio/jpeg_pvt.h Outdated Show resolved Hide resolved
src/jpeg.imageio/jpeginput.cpp Outdated Show resolved Hide resolved
src/jpeg.imageio/jpeginput.cpp Outdated Show resolved Hide resolved
@mugulmd mugulmd force-pushed the jpeg-ultrahdr branch 3 times, most recently from ac8f6b7 to 5c0698e Compare October 10, 2024 14:48
@mugulmd
Copy link
Contributor Author

mugulmd commented Oct 10, 2024

@lgritz quick question: I will need to add at least one Ultra HDR image for the test suite. The ones I use for testing locally weigh a bit more than 2M. Should I add them directly to the OpenImageIO repo, or should I create a PR in OpenImageIO-images to add them there ?

@lgritz
Copy link
Collaborator

lgritz commented Oct 10, 2024

Images repo, please

Signed-off-by: loicvital <[email protected]>
@mugulmd
Copy link
Contributor Author

mugulmd commented Nov 6, 2024

Alright @lgritz I think we're good to go. Thanks for the review(s) :)
If there's anything more you'd like to add don't hesitate !

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, this looks great.

Thanks, this is a really interesting feature. I hope that this convention is embraced and we see lots of images that look like old school JPEGs to naive viewers but are HDR to the ones that know better.

@lgritz lgritz merged commit 30f6a0a into AcademySoftwareFoundation:main Nov 6, 2024
29 checks passed
@lgritz lgritz added the file formats Image file formats, ImageInput, ImageOutput label Nov 6, 2024
@mugulmd
Copy link
Contributor Author

mugulmd commented Nov 6, 2024

There's still quite a few features from libuhdr we could expose in oiio, but yeah that felt like a pretty good starting point !

lgritz pushed a commit to lgritz/OpenImageIO that referenced this pull request Nov 10, 2024
…on#4484)

Initial feature request: AcademySoftwareFoundation#4424

Add support in the `jpeg` plugin for reading Ultra HDR images using the reference codec `libultrahdr`: https://github.com/google/libultrahdr

In short, "ultra hdr" images are a clever extension of JPEG where the image file really is an old school JPEG file and will be interpreted correctly as such by old readers not aware of ultra hdr, but readers that are aware will see an extra piece of metadata that contains a gain map, that when applied to the base layer then yields an HDR image. Pretty clever approach!

Images used for testing during development:
https://github.com/MishaalRahmanGH/Ultra_HDR_Samples

---------

Signed-off-by: loicvital <[email protected]>
lgritz pushed a commit to lgritz/OpenImageIO that referenced this pull request Nov 10, 2024
…on#4484)

Initial feature request: AcademySoftwareFoundation#4424

Add support in the `jpeg` plugin for reading Ultra HDR images using the reference codec `libultrahdr`: https://github.com/google/libultrahdr

In short, "ultra hdr" images are a clever extension of JPEG where the image file really is an old school JPEG file and will be interpreted correctly as such by old readers not aware of ultra hdr, but readers that are aware will see an extra piece of metadata that contains a gain map, that when applied to the base layer then yields an HDR image. Pretty clever approach!

Images used for testing during development:
https://github.com/MishaalRahmanGH/Ultra_HDR_Samples

---------

Signed-off-by: loicvital <[email protected]>
lgritz pushed a commit to lgritz/OpenImageIO that referenced this pull request Nov 13, 2024
…on#4484)

Initial feature request: AcademySoftwareFoundation#4424

Add support in the `jpeg` plugin for reading Ultra HDR images using the reference codec `libultrahdr`: https://github.com/google/libultrahdr

In short, "ultra hdr" images are a clever extension of JPEG where the image file really is an old school JPEG file and will be interpreted correctly as such by old readers not aware of ultra hdr, but readers that are aware will see an extra piece of metadata that contains a gain map, that when applied to the base layer then yields an HDR image. Pretty clever approach!

Images used for testing during development:
https://github.com/MishaalRahmanGH/Ultra_HDR_Samples

---------

Signed-off-by: loicvital <[email protected]>
lgritz pushed a commit to lgritz/OpenImageIO that referenced this pull request Nov 21, 2024
…on#4484)

Initial feature request: AcademySoftwareFoundation#4424

Add support in the `jpeg` plugin for reading Ultra HDR images using the reference codec `libultrahdr`: https://github.com/google/libultrahdr

In short, "ultra hdr" images are a clever extension of JPEG where the image file really is an old school JPEG file and will be interpreted correctly as such by old readers not aware of ultra hdr, but readers that are aware will see an extra piece of metadata that contains a gain map, that when applied to the base layer then yields an HDR image. Pretty clever approach!

Images used for testing during development:
https://github.com/MishaalRahmanGH/Ultra_HDR_Samples

---------

Signed-off-by: loicvital <[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.

3 participants