hey,

On Fri, May 19, 2017 at 8:20 AM, Patrick Rudin <rud...@solnet.ch> wrote:
> johannes hanika wrote:
>> these out-of-gamut/imaginary stimuli result in negative L values in
>> the pipeline.
>
> Could you explain a bit further how exactly this negative L-value is
> created? I always thought the camera-specific profile is a kind of LUT,
> but obviously it is a bit more complicated :)

hmm let me try this.

if you are using a lut profile, this may be better/more precise. by
default, we use a linear approximation to that, the colour matrices.
what happens on the sensor is that a spectral power distribution of
incoming light is converted to an rgb stimulus, depending on the
sensor responsivity. now you're in camera rgb. but you actually would
have liked to be in xyz (which has different colour matching
functions, the answer to the incoming spectral power distribution
depending on wavelength). unfortunately this first step happens in
hardware, so now we need to work with camera rgb.

using a matrix for the conversion to xyz amounts to claiming this
transformation is linear. which turns out to be a blatant lie.
unsurprisingly so if you think about the continuous spectral data
coming in (applying the colour matching functions is a linear
operation, but on a higher dimensional space, so a 3D matrix will not
be perfect). so these matrices are fitted in some least squares sense,
being a better approximation for colours you care about more. for
different sensors this may result in quite coarse approximation errors
for saturated colours, far away from the white point. sometimes they
are pushed outside of the spectral locus. that means you'd need
negative energy or something weird to produce a stimulus like this.

that's what often happens for deeply saturated blue tones, and if you
just continue to compute with them as usual, strange things happen.

i suppose we could detect the 0,0,0 special case in the
brightness/saturation/contrast module.. but then as soon as you put
the slider to 0.0001 it'll behave the same strange way. sometimes it's
possible to code functions in a way that they gracefully pass on
meaningless colour values, sometimes it's harder.

the other alternative is to always force clipping to the Lab gamut,
but i somehow like to have the possibility to just pass on whatever we
get as input, without truncating data.

cheers,
 jo

> I know that all extreme values in a or b-channel are out of gamut in
> sRGB, but how can a clipping in the blue camera-channel lead to a
> negative L-value?
>
>
> Regards
>
> Patrick
> ____________________________________________________________________________
> darktable user mailing list
> to unsubscribe send a mail to darktable-user+unsubscr...@lists.darktable.org
>
____________________________________________________________________________
darktable user mailing list
to unsubscribe send a mail to darktable-user+unsubscr...@lists.darktable.org

Reply via email to