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

Log profile : fix the luma estimation in the auto-optimizer. #1765

Merged
merged 1 commit into from Oct 22, 2018

Conversation

aurelienpierre
Copy link
Member

The luma is the energy of the light, computed from the RGB trichromatic signal.
This implies knowing in which RGB space we are, but this module is applied before
the input color profile, so it is a medium-relative RGB un-normalized space.
Previously, we assumed to be in ProPhotoRGB because it
is the largest RGB space. While it gives fair results most of the time, some sensors
behave quite poorly, especially those having a strong green cast in the shadows
at high ISO, because the G channel weighs for 72 % in the luma computation.

As a less precise, but more robust, estimator of the luma, we now take the max of the RGB
channels for each sample (grey, black, white). This doesn't always remap the L values (in Lab)
between [17; 96] (the black is sometimes in [0; 12]), but avoids silly remappings
(black = [25; 60]) that happened with the previous approach.

The luma is the energy of the light, computed from the RGB trichromatic signal.
This implies knowing in which RGB space we are, but this module is applied before
the input color profile, so it is a medium-relative RGB unnormalized space.
Previously, we assumed to be in ProPhotoRGB because it
is the largest RGB space. While it gives fair results most of the time, some sensors
behave quite poorly, especially those having a strong green cast in the shadows
at high ISO, because the G channel weighs for 72 % in the luma computation.

As a less precise, but more robust, estimator of the luma, we now take the max of the RGB
channels for each sample (grey, black, white). This doesn't always remap the L values (in Lab)
between [17; 96] (the black is sometimes in [0; 12]), but avoids silly remappings
(black = [25; 60]) that happened with the previous approach.
@TurboGit TurboGit self-assigned this Oct 22, 2018
@TurboGit
Copy link
Member

Just found out that changing the grey-fulcrum does nothing until we have changed contrast too. Is that expected? That's not a regression due to this patch as it is already the behavior on master. Just checking...

@aurelienpierre
Copy link
Member Author

Yes, it's normal. When adding contrast, what it does actually is lighting greys > fulcrum and darkening greys < fulcrum. The fulcrum is the grey that is not affected by the correction, and sets the transition point.

@TurboGit
Copy link
Member

Perfect then, thanks.

@TurboGit TurboGit merged commit 4a9f26f into darktable-org:master Oct 22, 2018
@TurboGit TurboGit added bugfix pull request fixing a bug feature: enhancement current features to improve labels Oct 22, 2018
@TurboGit TurboGit self-requested a review October 22, 2018 15:37
@TurboGit TurboGit added this to the 2.6 milestone Oct 22, 2018
@aurelienpierre aurelienpierre deleted the log_profile branch December 12, 2022 00:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix pull request fixing a bug feature: enhancement current features to improve
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants