Repository navigation
Conversation
Off by default. A gain map is applied with kCGImageSourceDecodeToHDR, and the image skips decompression, because preparingForDisplay() goes back to the SDR base. A request with processors stays standard, and HDR is never encoded for the disk cache.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds opt-in HDR:
ImageRequest.dynamicRangeapplies gain maps withkCGImageSourceDecodeToHDR, andLazyImage.allowedDynamicRange(_:)also displays them. Standard requests decode as before. Thumbnails keep HDR; a request with processors stays standard, because they draw in 8 bits. See the newhigh-dynamic-rangearticle.Proof
.standard1.02 →.high8.84,isHighDynamicRangetrue. macOS keeps it in 10 bits, also at 8.84..highfalls back to the SDR base (0.88). A 10-bit PQ HEIC reaches 4.17 there. Removing the guard failsgainMapIsApplied.preparingForDisplay()flattens a gain map (3.51 → 0.88), so HDR skips decompression. Removing that failsdecompressionIsSkipped; the memory key, disk and processor rules are mutation-checked too.Nukeand 5 newNukeUItests. macOS 1,783 + 638, iOS 27 1,831 + 648, tvOS 27 1,828 + 648: onlyImagePipelinePreviewPolicyTestsfailed, under load, which it also does onmain, and it passes alone. watchOS, visionOS, SPM and snippets compile.ImageRequeststays 112 bytes, a cache read is +7 instructions (+0.35%), a full load −0.65% against a control at −0.65%.