Skip to content

Preserve HDR samples and expand high-precision TIFF/EXR support - #3201

Merged
JimBobSquarePants merged 10 commits into
mainfrom
js/exr-hdr-v5-plan
Sep 28, 2026
Merged

JimBobSquarePants merged 10 commits into
mainfrom
js/exr-hdr-v5-plan

Conversation

@JimBobSquarePants

Copy link
Copy Markdown
Member

Prerequisites

  • I have written a descriptive pull-request title
  • I have verified that there are no overlapping pull-requests open
  • I have verified that I am following the existing coding patterns and practice as demonstrated in the repository. These follow strict Stylecop rules 👮.
  • I have provided test coverage for my change (where applicable)

Description

Default EXR HALF/FLOAT and floating-point TIFF loads previously passed through bounded pixel storage, losing HDR values. This change selects floating-point pixel storage for those loads and preserves out-of-range samples through the shared pixel conversion path. Associated floating-point pixels also retain stored color at zero alpha.

TIFF encoding now supports IEEE 32-bit floating-point grayscale and color output, plus unsigned 16-bit and 32-bit color output. The TIFF and EXR codec READMEs document their current sample and compression support. SIMD float-plane operations handle bulk conversion, while processor histogram indices remain bounded and percentage thresholds use the observed metric range. This also adds the one-click AutoLevel extension.

Related to #3194.

Validation

  • Release solution builds and the pixel-format, codec, SIMD, and processor tests passed on net10.0 and net11.0 before the final README-only commit.
  • libtiff decoded 31 ImageSharp-written TIFF files across the supported compression modes; all 9,750 samples matched.
  • OpenEXR decoded five ImageSharp-written HDR EXR files; all 1,300 channel samples matched, including nonfinite values and stored color at zero alpha. Its reader also accepted ZIPS output.

@JimBobSquarePants JimBobSquarePants added this to the v5.0.0 milestone Sep 28, 2026
@JimBobSquarePants JimBobSquarePants linked an issue Sep 28, 2026 that may be closed by this pull request
4 tasks
@JimBobSquarePants JimBobSquarePants added enhancement formats:tiff breaking Signifies a binary breaking change. formats:exr Any PR or issue related to OpenExr file format labels Sep 28, 2026
Comment thread tests/ImageSharp.Tests/TestUtilities/ApproximateFloatComparer.cs Dismissed
Comment thread tests/ImageSharp.Tests/Formats/Tiff/TiffMetadataTests.cs Dismissed
Comment thread tests/ImageSharp.Tests/Formats/Tiff/TiffMetadataTests.cs Dismissed
Comment thread tests/ImageSharp.Tests/Formats/Tiff/TiffMetadataTests.cs Dismissed
Comment thread src/ImageSharp/Formats/Tiff/TiffEncoderCore.cs Dismissed
@JimBobSquarePants
JimBobSquarePants merged commit c0ee744 into main Sep 28, 2026
12 checks passed
@JimBobSquarePants
JimBobSquarePants deleted the js/exr-hdr-v5-plan branch September 28, 2026 05:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Signifies a binary breaking change. enhancement formats:exr Any PR or issue related to OpenExr file format formats:tiff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OpenEXR color data is incorrect when using HalfVector4

1 participant