darktable-org / darktable

darktable is an open source photography workflow application and raw developer
https://www.darktable.org
GNU General Public License v3.0
9.5k stars 1.12k forks source link

colorin code modernization #9106

Open dtorop opened 3 years ago

dtorop commented 3 years ago

Is your feature request related to a problem? Please describe.

The colorin code is fairly original to darktable, and could be integrated more deeply with more recent work.

integration with iop_profile

processing

Describe the solution you'd like

This work could all be done early in the v3.8 cycle, so there'd be adequate time to test for unexpected side-effects.

Alternatives

Leave code as is. Or selectively do some but not all of these things.

Additional context (risks)

The iop_profile code (dt_ioppr_generate_profile_info()) will only pull matrices from the profile if both the input & output directions are matrix only (not CLUT). For colorin, we only care about the input direction. Would there be any profiles which are matrix input both CLUT output, hence causing a regression if we switch to iop_profile code?

phweyland commented 3 years ago

I don't know if this is related to that topic but it should not very far, ... I'm thinking about 3D LUT making the transform between log camera encoding to a given color space. Is there a way to consider this ? Is colorin the right place ?

aurelienpierre commented 3 years ago

I have exactly that in the pipe. Work is started.

dtorop commented 3 years ago

I have exactly that in the pipe. Work is started.

@aurelienpierre Great! If any help, I roughed out some profile handling changes (or at least FIXME's) before/while writing this FR: ef132e9c72cf9c9a61a28d23fab244784ad0bcc6. As the commit message notes, I haven't even tried to compile them.

On thinking it over, it seems like a good path would be for commit_params to even earlier call dt_ioppr_set_pipe_input_profile_info, and that should do as much work as possible. Then failing the matrix route, commit_params (or iop_profile?) would set up the LCMS fallback.

It seems like the goal of all this work would be to make a PR which makes absolutely no functional change to dt, but ideally would result in more legible, less bugprone, and perhaps faster code.

(Though one functional change may be that colorin sees rec.709 as the fallback colorspace, and iop_profile sees rec.2020 as the fallback. For modern cameras, is rec.2020 the better choice? Would switching break extant histories?)

Then there's colorout -- it's way less verbose now, but perhaps it could benefit from a similar lookover?

I'm thinking about 3D LUT making the transform between log camera encoding to a given color space.

@phweyland I wish I had the expertise/experience here. Would this involve setting up an an alternate path -- rather than overloading colorin, allowing for the existing lut3d or lut3dgmic modules to be repurposed to do this?

Not sure if log encoding situation adds more wrinkles, e.g. to LUT resolution. My impression is LCMS CLUT as used by dt is significantly slower than matrix and per-channel LUT methods, but at a guess lut3d/lut3dgmic are good/fast...?

github-actions[bot] commented 3 years ago

This issue did not get any activity in the past 30 days and will be closed in 365 days if no update occurs. Please check if the master branch has fixed it and report again or close the issue.

ralfbrown commented 1 year ago

Rewrite of the processing code is largely completed, with the majority of the SSE code removed.

Any activity on integration with iop_profile?

github-actions[bot] commented 1 year ago

This issue has been marked as stale due to inactivity for the last 60 days. It will be automatically closed in 300 days if no update occurs. Please check if the master branch has fixed it and report again or close the issue.

github-actions[bot] commented 4 months ago

This issue has been marked as stale due to inactivity for the last 60 days. It will be automatically closed in 300 days if no update occurs. Please check if the master branch has fixed it and report again or close the issue.