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

Initial JPEG XL support for image input/output #4055

Merged
merged 109 commits into from
Mar 16, 2024
Merged
Show file tree
Hide file tree
Changes from 91 commits
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
9808a9e
Initial JPEG XL support for image input
1div0 Nov 18, 2023
a80702e
Avoid macro redefined error
1div0 Nov 19, 2023
dd85255
ci: Remove MacOS-11 test (#4053)
lgritz Nov 20, 2023
ac5dca6
chore: more switching fprintf/etc to new style print (#4056)
lgritz Nov 20, 2023
ef06678
ci: test against gcc-13 (#4059)
lgritz Nov 23, 2023
a762525
doc: Update INSTALL.md to reflect the latest versions we've tested ag…
lgritz Nov 23, 2023
9091e93
fix: Remove redundant line in .clang-format (#4057)
lgritz Nov 24, 2023
3444cf8
fix(oiiotool): --autocc bugfix and color config inventory cleanup (#4…
lgritz Nov 24, 2023
5720ab1
Bump patch level
lgritz Nov 24, 2023
1488f45
fix(simd.h): fix leaking of Imath.h into public headers (#4062)
lgritz Nov 24, 2023
b8edfa0
fix(diff): Fix issue when computing perceptual diff (#4061)
kohakukun Nov 24, 2023
cb5ddc2
test: improve color management test in imagebufalgo_test (#4063)
lgritz Nov 27, 2023
d30e9fc
test: Add one more ref output for python-colorconfig test (#4065)
lgritz Nov 27, 2023
a4d484f
build: fix include guard (#4066)
lgritz Nov 28, 2023
be4b97c
perf(simd): faster vint4 load/store with unsigned char conversion (#4…
aras-p Dec 8, 2023
14c47fa
build: ptex support for static library (#4072)
domin144 Dec 9, 2023
5a71ce3
fix(jpeg2000): include the headers we need to discern version (#4073)
lgritz Dec 10, 2023
74705a1
fix(png): Fix crash for writing large PNGs with alpha (#4074)
lgritz Dec 13, 2023
c06f573
ci: restrict Mac ARM running (#4077)
lgritz Dec 18, 2023
e7ee3ef
feat(iv): OCIO color managed display (#4031)
antond-weta Dec 19, 2023
f61e28e
feat(ImageBuf): make IB::Iterator lazy in its making the image writab…
lgritz Dec 19, 2023
07c17b5
admin: Account for duplicate emails in the .mailmap (#4075)
lgritz Dec 20, 2023
65a0888
fix: Only check REST arguments if the file does not exist (#4085)
AdamMainsTL Dec 22, 2023
97e1d03
Fix link to openexr test images (#4080)
jessey-git Dec 22, 2023
7a73e5f
docs: fix typo (#4089)
lgritz Dec 24, 2023
f6f9e26
ci: Rename macro to avoid conflict during CI unity builds (#4092)
lgritz Dec 24, 2023
3037b71
perf: Improve perf of IBA::channels in-place operation (#4088)
lgritz Dec 25, 2023
27e898e
build: Add a way to cram in a custom extra library for iv (#4086)
lgritz Dec 27, 2023
2226201
fix(iv): avoid crash with OpenGL + multi-channel images (#4087)
lgritz Dec 27, 2023
a6585e5
ci: Repair Sonar scanner analysis (#4097)
lgritz Dec 30, 2023
35ee9f1
test: Shuffle some tests between directories (#4091)
lgritz Dec 30, 2023
58516aa
ci: Revert bad branch exclusion -- doesn't work as I thought it would…
lgritz Dec 31, 2023
90750f6
docs: Minor change to formatting and naming (#4098)
lgritz Jan 1, 2024
802ad7d
fix(simd.h): Make all-architecture matrix44::inverse() (#4076)
lgritz Jan 2, 2024
7be367e
test: Fix docs test, used wrong namespace (#4090)
lgritz Jan 2, 2024
a342d74
feat(oiiotool): oiiotool --cryptomatte-colors (#4093)
lgritz Jan 2, 2024
ffc1345
CHANGES update and bump master patch designation
lgritz Jan 2, 2024
942ad02
build: Remove Findfmt.cmake (#4069)
domin144 Jan 5, 2024
ff4124c
int: OIIO::bitcast adjustments (#4101)
lgritz Jan 5, 2024
a8c385a
build: clean up after removing Findfmt.cmake (#4103)
domin144 Jan 7, 2024
28ddc59
style: update our formatting standard to clang-format 17.0 and C++17 …
lgritz Jan 8, 2024
a09937e
fix(raw): Avoid buffer overrun for flip direction cases (#4100)
lgritz Jan 8, 2024
8f2299c
admin: Switch to jmertic's slack notifier action (#4079)
lgritz Jan 9, 2024
5aceb5c
build(deps): Account for header changes in fmt project trunk (#4109)
lgritz Jan 14, 2024
a0a74a3
docs: Fix broken IBA color management documentation (#4104)
lgritz Jan 16, 2024
86d40a2
Fixes to reduce problems identified by static analysis (#4113)
lgritz Jan 17, 2024
779b744
fix(dev): Make sure C++ knows ustring & ustringhash are trivially cop…
lgritz Jan 17, 2024
536c646
build(deps): deal with changes in fmt's trunk (#4114)
lgritz Jan 18, 2024
82eccfe
refactor(simd.h): Simplify vbool16 casting (#4105)
lgritz Jan 19, 2024
f1079a3
Fix typos (#4116)
lgritz Jan 19, 2024
e5b819f
fix(simd.h): AVX-512 round function (#4119)
AngryLoki Jan 20, 2024
be72bbc
fix: Improve over-blurring of certain oiiotool --fit situations (#4108)
lgritz Jan 20, 2024
847f0a0
refactor(fmath.h): Move bitcast, byteswap, and rotl/rotr to new bit.h…
lgritz Jan 22, 2024
a2d3aa5
style: Add recent reformatting to .git-blame-ignore-revs (#4122)
lgritz Jan 23, 2024
793b3eb
feat(openexr): Add support for luminance-chroma OpenEXR images. (#4070)
jreichel-nvidia Jan 23, 2024
e92123d
ci: improve parallel builds by basing on number of cores (#4115)
lgritz Jan 24, 2024
e7387ab
build: correctly disable OpenVDB when it's incompatible (#4120)
lgritz Jan 26, 2024
70a2bd4
iv: Assume iv display gamma 2.2 (#4118)
lgritz Jan 27, 2024
b24a108
feat: query/print build information (#4124)
lgritz Jan 30, 2024
74c5f0b
ci: Update all github actions to their latest versions that's compati…
lgritz Jan 30, 2024
439ec0d
ci: Bump 'latest' test to newer dep versions, document (#4130)
lgritz Jan 30, 2024
01c1e88
fix: certain int->float type conversions in TypeDesc/ParamValueList (…
lgritz Jan 30, 2024
9022ffc
ci: Revert to fix scorecard analysis, try version 2.0.6
lgritz Jan 30, 2024
cce46a5
int: span and range checking enhancements (#4125)
lgritz Jan 30, 2024
39a7a55
Update CHANGES and bump patch version
lgritz Jan 30, 2024
ffadbdc
build: don't fail pybind11 search if python is disabled (#4136)
lgritz Feb 1, 2024
6b99ff4
docs: update SECURITY and RELEASING documentation (#4138)
lgritz Feb 2, 2024
88dd2f4
docs: Fix tab that was missing from the rendering on rtd (#4137)
lgritz Feb 2, 2024
a51518a
ci: Start using macos-14 ARM runners, bump latest OCIO (#4134)
lgritz Feb 2, 2024
b5ab45d
Internals: various fixes for memory safey and reduce static analysis …
lgritz Feb 3, 2024
b01b089
docs: Fix python example (#4139)
lgritz Feb 5, 2024
377f467
ci: Switch away from deprecated GHA idiom set-output (#4141)
lgritz Feb 5, 2024
35b2f1c
fix(simd.h): Address NEON issues (#4143)
lgritz Feb 8, 2024
ca95735
fix(oiiotool): Overhaul and fix bugs in mixed-channel propogation (#4…
lgritz Feb 8, 2024
1b5c20c
cleanup: Coalesce redundant STRINGIZE macros -> OIIO_STRINGIZE (#4121)
lgritz Feb 8, 2024
3d5df4d
testing/api: Add test for filter values and 'filter_list' query (#4140)
lgritz Feb 10, 2024
6f15533
Add JPEG XL file type to ignored files
1div0 Feb 16, 2024
981010e
Add JPEG XL file type to the list of supported image formats
1div0 Feb 16, 2024
dcc6dbd
Added links to JPEG XL info and test files
1div0 Feb 23, 2024
b9a51b2
Added license and updated the includes variable
1div0 Feb 23, 2024
5d593ff
[WIP] Add JPEG XL output
1div0 Feb 24, 2024
19848e0
Restored from master after failed rebase
1div0 Feb 24, 2024
0a3e780
Merge branch 'master' into JPEG XL
1div0 Feb 24, 2024
2776531
[WIP] Output just black JPEG XL image
1div0 Feb 26, 2024
dc69099
[WIP] Use OIIO_STRINGIZE macro instead of STRINGIZE
1div0 Feb 26, 2024
835a42a
[WIP] One step closer to working output
1div0 Feb 26, 2024
2e4a0fe
[WIP] Latest debug code added
1div0 Feb 26, 2024
5366465
clang-format
1div0 Feb 27, 2024
9896689
Merge branch 'master' into JPEG XL
1div0 Feb 27, 2024
a11f045
JPEG XL output works now
1div0 Feb 27, 2024
2bfc294
Add JPEG XL library version detection to CMake
1div0 Feb 28, 2024
5aaab06
Updated and tested against v0.10.1
1div0 Mar 4, 2024
1438af4
Removed redundant text file
1div0 Mar 4, 2024
65f9e14
Add out of range check
1div0 Mar 4, 2024
64b8dd6
Modified the error reporting according to review comment
1div0 Mar 4, 2024
c58c8ea
Corrected the range check
1div0 Mar 4, 2024
a45a502
Add minimum required version of the reference JPEG XL library
1div0 Mar 4, 2024
69c4392
clang-format
1div0 Mar 5, 2024
00ad4dc
Avoid fprintf to stderr
1div0 Mar 5, 2024
641cfc8
clang-format once again
1div0 Mar 6, 2024
9d391d8
Changed the image format name to official name instead of the file na…
1div0 Mar 6, 2024
1dee843
Let's call the format "jpegxl"
1div0 Mar 6, 2024
cef3e00
Rename the JPEG XL plug-in
1div0 Mar 6, 2024
f16981c
Extended encoder error reporting
1div0 Mar 8, 2024
2ae90e3
Add α channel
1div0 Mar 9, 2024
c086df7
Print out subtle difference between written and read image
1div0 Mar 9, 2024
e169c3e
clang-format
lgritz Mar 16, 2024
40a03e0
Limit how much error spews when images don't match
lgritz Mar 16, 2024
3635d53
Clean up approximate matches for lossy formats
lgritz Mar 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ _coverage/
/*.exr
/*.tif
/*.jpg
/*.jxl
/*.tx
/*.log
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ OpenImageIO consists of:
plugin can be found at runtime.

* Plugins implementing I/O for several popular image file formats,
including TIFF, JPEG/JFIF, OpenEXR, PNG, HDR/RGBE, ICO, BMP, Targa,
including TIFF, JPEG/JFIF, JPEG XL, OpenEXR, PNG, HDR/RGBE, ICO, BMP, Targa,
JPEG-2000, RMan Zfile, FITS, DDS, Softimage PIC, PNM, DPX, Cineon,
IFF, OpenVDB, Ptex, Photoshop PSD, Wavefront RLA, SGI, WebP,
GIF, DICOM, HEIF/HEIC/AVIF, many "RAW" digital camera formats, and a variety
Expand Down
5 changes: 5 additions & 0 deletions src/cmake/externalpackages.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,11 @@ if (NOT TARGET libjpeg-turbo::jpeg) # Try to find the non-turbo version
checked_find_package (JPEG REQUIRED)
endif ()

# JPEG XL
option (USE_JXL "Enable JPEG XL support" ON)
checked_find_package (JXL
DEFINITIONS -DUSE_JXL=1)
lgritz marked this conversation as resolved.
Show resolved Hide resolved

# Pugixml setup. Normally we just use the version bundled with oiio, but
# some linux distros are quite particular about having separate packages so we
# allow this to be overridden to use the distro-provided package if desired.
Expand Down
45 changes: 45 additions & 0 deletions src/cmake/modules/FindJXL.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Copyright Contributors to the OpenImageIO project.
# SPDX-License-Identifier: Apache-2.0
# https://github.com/AcademySoftwareFoundation/OpenImageIO
#
# Module to find libjxl
#
# Will define:
# - JXL_FOUND
# - JXL_INCLUDES directory to include for libjxl headers
# - JXL_LIBRARIES libraries to link to

include (FindPackageHandleStandardArgs)

find_path(JXL_INCLUDE_DIR
NAMES jxl/decode.h jxl/encode.h)
mark_as_advanced(JXL_INCLUDE_DIR)

if (JXL_INCLUDE_DIR)
file (STRINGS "${JXL_INCLUDE_DIR}/jxl/version.h" TMP REGEX "^#define JPEGXL_MAJOR_VERSION .*$")
string (REGEX MATCHALL "[0-9]+" JPEGXL_MAJOR_VERSION ${TMP})
file (STRINGS "${JXL_INCLUDE_DIR}/jxl/version.h" TMP REGEX "^#define JPEGXL_MINOR_VERSION .*$")
string (REGEX MATCHALL "[0-9]+" JPEGXL_MINOR_VERSION ${TMP})
file (STRINGS "${JXL_INCLUDE_DIR}/jxl/version.h" TMP REGEX "^#define JPEGXL_PATCH_VERSION .*$")
string (REGEX MATCHALL "[0-9]+" JPEGXL_PATCH_VERSION ${TMP})
set (JXL_VERSION "${JPEGXL_MAJOR_VERSION}.${JPEGXL_MINOR_VERSION}.${JPEGXL_PATCH_VERSION}")
endif ()

find_library(JXL_LIBRARY
NAMES jxl)
mark_as_advanced (
JXL_LIBRARY
JXL_VERSION
)

find_library(JXL_THREADS_LIBRARY
NAMES jxl_threads)
mark_as_advanced(JXL_THREADS_LIBRARY)

find_package_handle_standard_args(JXL
REQUIRED_VARS JXL_LIBRARY JXL_THREADS_LIBRARY JXL_INCLUDE_DIR)

if(JXL_FOUND)
set(JXL_LIBRARIES ${JXL_LIBRARY} ${JXL_THREADS_LIBRARY})
set(JXL_INCLUDES ${JXL_INCLUDE_DIR})
endif(JXL_FOUND)
3 changes: 2 additions & 1 deletion src/iv/imageviewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ IsSpecSrgb(const ImageSpec& spec)
// clang-format off
static const char *s_file_filters = ""
"Image Files (*.bmp *.cin *.dcm *.dds *.dpx *.fits *.gif *.hdr *.ico *.iff "
"*.jpg *.jpe *.jpeg *.jif *.jfif *.jfi *.jp2 *.j2k *.exr *.png *.pbm *.pgm "
"*.jpg *.jpe *.jpeg *.jif *.jfif *.jfi *.jp2 *.j2k *.jxl *.exr *.png *.pbm *.pgm "
"*.ppm *.psd *.ptex *.rla *.sgi *.rgb *.rgba *.bw *.int *.inta *.pic *.tga "
"*.tpic *.tif *.tiff *.tx *.env *.sm *.vsm *.vdb *.webp *.zfile);;"
"BMP (*.bmp);;"
Expand All @@ -78,6 +78,7 @@ static const char *s_file_filters = ""
"IFF (*.iff);;"
"JPEG (*.jpg *.jpe *.jpeg *.jif *.jfif *.jfi);;"
"JPEG-2000 (*.jp2 *.j2k);;"
"JPEG XL (*.jxl);;"
"OpenEXR (*.exr);;"
"OpenVDB (*.vdb);;"
"PhotoShop (*.psd);;"
Expand Down
12 changes: 12 additions & 0 deletions src/jxl.imageio/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Copyright Contributors to the OpenImageIO project.
# SPDX-License-Identifier: Apache-2.0
# https://github.com/AcademySoftwareFoundation/OpenImageIO

if (JXL_FOUND)
add_oiio_plugin (jxlinput.cpp jxloutput.cpp
INCLUDE_DIRS ${JXL_INCLUDE_DIRS}
LINK_LIBRARIES ${JXL_LIBRARIES}
DEFINITIONS "-DUSE_JXL")
else()
message (WARNING "JPEG XL plugin will not be built")
endif()
8 changes: 8 additions & 0 deletions src/jxl.imageio/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# JPEG XL

* https://jpegxl.info
* https://jpegxl.info/test-page
* https://people.csail.mit.edu/ericchan/hdr/hdr-jxl.php
* https://saklistudio.com/jxltests
* https://thorium.rocks
* https://bugs.chromium.org/p/chromium/issues/detail?id=1451807
1div0 marked this conversation as resolved.
Show resolved Hide resolved
Loading
Loading