hello,

I have partially solved the issue with the wrong readings of the color
picker : there is actually a function
dt_dev_pixelpipe_process_no_gamma() in src/dev/pixelpipe_hb.c that
temporarily disables the gamma IOP to get the reading. I have modified
it to disable the colorout IOP instead. That fixes the problem when
LittleCMS is not used.

I think the color management needs a cleaning. Looking at the code in
pixelpipe_hb.c, a lot of bad things happen :

  * the histogram and color picker are computed after the display
    profile is applied. So, in a multi-screen setup, you don't get the
    same histogram depending on the screen you are using. So much for
    consistency and reproductibility…
  * the Lab values of the color picker are computed by reverting the
    display profile (which means creating a new inverse virtual profile,
    and applying it each time the pixelpipe is run). So much for
    performance…

I think these parts would be better moved in the colorout IOP, to take
real Lab readings before any RGB conversion and to use the (proper)
output color profile instead of the display one to perform RGB conversions.

Also, continuing with the display color profile… The color management
pipe in dt seems to be as follow :

    camera RGB/CFA -> [ input profile ] -> Lab -> [ output profile ] ->
    display RGB -> [ OS color management / display ICC profile ] ->
    video output.

When darktable is set to use the system display profile, aren't we
correcting twice the picture for the display (one in dt, one before the
GPU output) ? I'm kind of lost here.

Moreover, the internal display correction applies the gamma tonecurve of
the display profile, so the actual 50 % Lab grey is always displayed at
75 % on the screen, which shouldn't happen. It doesn't make sense to
have linear REC 709 and 2020 profiles built-in, and never ever be able
to see actual linear data.

I'm currently adding an option in colorout to bypass the gamma and
enable a linear workflow. It works with the internal dt color
management, but LittleCMS doesn't seem to allow to remove the TRC and
keep only the RGB primaries. Any help welcome.

Thanks,

Aurélien.

Le 03/11/2018 à 09:15, johannes hanika a écrit :
> Hey,
>
> One more reason for gamma.c: legacy. In 2009 when the pipeline was the
> one of ufraw, this was actually used. So in case someone opens 10yo
> shots now they depend on the iop.
>
> Re: colorpicker. that's a known issue, we don't run multiple pipelines
> so the colorpicker reads whatever there is at the end.
>
> No clue about your logspace issue. Maybe you picked in lab after
> display profile transform? that'll have gamma and cbrt().
>
> Cheers
> Jo
>
> On Sat, 3 Nov 2018, 10:05 Andreas Schneider, <a...@cryptomilk.org
> <mailto:a...@cryptomilk.org>> wrote:
>
>     On Saturday, 3 November 2018 09:59:23 CET Andreas Schneider wrote:
>     > On Friday, 2 November 2018 21:10:33 CET Aurélien Pierre wrote:
>     > > Hi Jo !
>     > >
>     > > Thanks for your answer.
>     > >
>     > > So this doesn't explain why the global colorpicker readings change
>     > > depending on the display ICC profile, nor why using a log encoding
>     > > between -2.5 and 2.5 EV, the grey gets remapped to L = 77
>     instead of 50.
>     > >
>     > > I believe there is a gamma correction where it doesn't belong.
>     Where is
>     > > the code for the colorpicker ?
>     >
>     > Aurélien,
>     >
>     > you broke image export with the latest change:
>     >
>     > See:
>     >
>     > https://xor.cryptomilk.org/darktable/broken.jpg
>
>     Oh, I get the same if I open it in the darkroom!
>
>     -- 
>     Andreas Schneider                 a...@cryptomilk.org
>     <mailto:a...@cryptomilk.org>
>     GPG-ID:     8DFF53E18F2ABC8D8F3C92237EE0FC4DCC014E3D
>
>
>     
> ___________________________________________________________________________
>     darktable developer mailing list
>     to unsubscribe send a mail to
>     darktable-dev+unsubscr...@lists.darktable.org
>     <mailto:darktable-dev%2bunsubscr...@lists.darktable.org>
>
>
> ___________________________________________________________________________
> darktable developer mailing list to unsubscribe send a mail to
> darktable-dev+unsubscr...@lists.darktable.org

___________________________________________________________________________
darktable developer mailing list
to unsubscribe send a mail to darktable-dev+unsubscr...@lists.darktable.org

Reply via email to