-
Notifications
You must be signed in to change notification settings - Fork 1.3k
RFC: Gamma corrected pipe input scaling for rgb images #20004
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
base: master
Are you sure you want to change the base?
RFC: Gamma corrected pipe input scaling for rgb images #20004
Conversation
+1 I've also proposed in the past having dt's architecture allows modules to vary their input and output color spaces according to current conditions, with the pixelpipe handling any necessary conversions if there is a mismatch with the previous/next modules. |
|
Absolutely right. Working on that, pr following later but soon. Although the situation in colorin input data is more complicated. |
|
I agree that the back and forth superfluous conversion between Lab & RGB should be avoided. That's would be a nice improvement in speed and image quality. |
TurboGit
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works for me, thanks!
Non-raw images can have gamma corrected data as input possibly leading to bad results while we do the initial scaling. This scaling happens when generating the mipmap via `_init_f` and when inserting data into the pixelpipes. What we do now: - we test for the image having exif data as sRGB or AdobeRGB. - the colorin module does a much better check than exif data and possibly sets the profile type to any RGB mode. We keep track on this when setting the input profile and possibly change the image->colorspace (making sure to leave the exif checked data as they are). - dt_iop_clip_and_zoom() got an extra gboolean parameter `gamma`, if that is true the interpolation is encapsulated in rgb->linear and linear->rgb conversions. - we have a new kernel doing the flog gamma correction allowing OpenCL downscaling when inserting into the pipe. This results in improved data visualizing for all pipes and data taken from the preview pipe. qdefrve
d6a1049 to
bf6ac5f
Compare
|
Force-pushed an updated version.
Absolutely. But this can't be done here, that's all in I checked again if we could do the conversion in these parts of the code at least for non-raws, unfortunately not without a lot of messing in the code in all modules that might be in the pipe before colorin. |
Non-raw images can have gamma corrected data as input possibly leading to bad results while we do the initial scaling. This scaling happens when generating the mipmap via
_init_fand when inserting data into the pixelpipes.What we do now:
gamma, if that is true the interpolation is encapsulated in rgb->linear and linear->rgb conversions.This results in improved data visualizing for all pipes and data taken from the preview pipe.
Reminder:
This has been itching me for quite a while - since #13682 #13335 and #13682. One part of those issues has been solved by 6b18bae having final-scaling still in linear space.
The second problem discussed and demonstrated in the old issues is the initial feeding of non-linear data into the pipes.
Here are some images to be tested:
or the large nasa image https://commons.wikimedia.org/wiki/File:Earth%27s_City_Lights_by_DMSP,_1994-1995_(full).jpg (scroll down a bit and choose full image).
For me this is the first part of color-related stuff for 5.6. @kofa73 is likely working on improving white balance and i will take further care on colorin ...
@mediatechnologic started the discussion (i hope you are still reading and would be able to compile & test) @TurboGit as pening #13682