Fix raw highlights clipping #1219
Open
sevahul wants to merge 2 commits into
Open
Conversation
At the same time, avoid magneta highlight in the over-exposed regions
daad08f to
7251b69
Compare
Author
|
UPD:
|
Owner
|
Hi @sevahul Thanks for your PR! In my testing, I could recover much more detail with this slider than with your PR. Kind regards, |
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.



Description
This PR resolves an issue where high-brightness regions (highlights) in RAW files (such as
.NEF) were rendered unnaturally, flattening gradients into white blobs and suffering from "hue twists". It also restores the required HDR headroom (>1.0) so the downstream AgX filmic tonemapper can function correctly without being starved of dynamic range.In the second commit, a "show original" bug was fixed - the difference is now shown with the selected tone mapper instead of the hard-coded basic one.
Type of Change
Changes Made
whitelevel = u32::MAXoverride indevelop_internalto bypassrawler's automatic hard-clipping. This preserves >1.0 sensor values created by WB/color-matrix calibration for the downstream WGSL shader.soft_kneeroll-off mathematical shoulder.max_c), and the rest of the channels are scaled proportionally (soft_knee(max_c) / max_c). This preserves the precise RGB ratio, keeping saturated lights true to their color instead of twisting toward white.soft_kneescaling logic safely acrossThreeColor,Monochrome, andFourColorintermediate formats.Screenshots/Videos
Testing
Test Configuration:
Checklist
Additional Notes
By combining the HDR pass-through (giving the shader proper linear values) with the proportional chromaticity scalar, RapidRAW now accurately matches or exceeds the highlight volume rendering of natural RAW processors like Shotwell.
AI Disclaimer:
Please state the involvement of AI in this PR:
The AI indeed generated the above=)