[Digikam-users] Re: digiKam raw converter default gamma curve

Gilles Caulier caulier.gilles at gmail.com
Tue Mar 1 14:26:50 GMT 2011


2011/3/1 Elle Stone <l.elle.stone at gmail.com>:
> Pentii, not knowing what a Nikonian gamma curve is (in Canon there are
> "picture style" curves, but they are applied post-processing), I would
> like to ask, what it is that you want to have happen when you decode a
> raw file, that perhaps isn't happening with the digikam raw converter?
>
> Gilles, when you say "gamma curve" do you mean the gamma curve on the
> post-processing tab? because that is not the gamma that I'm talking
> about.
>
> I'm talking about the "gamma curve" in the code below ("ts" stands for
> "toe slope" - if it isn't 0, it isn't really a gamma curve):
>
> dcraw code:
> void CLASS gamma_curve (double pwr, double ts, int mode, int imax)
>
> Code from libkdcraw (line starting with double gamm[6]):
> (this section of code appears in another document, but it's the same
> both places)
>
> LibRaw:: LibRaw(unsigned int flags)
> {
>    double aber[4] = {1,1,1,1};
>    double gamm[6] = { 0.45,4.5,0,0,0,0 };
>    unsigned greybox[4] =  { 0, 0, UINT_MAX, UINT_MAX };
>    unsigned cropbox[4] =  { 0, 0, UINT_MAX, UINT_MAX };
>
> In the above libraw code gamm[6] has 0.45 as the "power" value and 4.5
> as the "toe slope" value.

I don't play with these settings in Raw import tool for digiKam image editor.

>
> dcraw uses the same defaults as  what is hard-coded into the LibRaw
> code snippet above. UFRaw defaults are close visually, but I don't
> know what scale or math-model UFRaw uses in the gui for allowing the
> user to set the toe slope (toe-slope is called "linearity" in UFRaw).
>
> In UFRAW and in dcraw the end user, that is, the person using the
> programs to decode raw files, can specify OTHER values, such as "0"
> for the toe slope, to get a true gamma curve DURING interpolation.
>
> Gamma applied post-processing canNOT make up for whatever gamma was
> applied during raw rendering. Especially not if a non-zero toe-slope
> was used during raw rendering.
>
> Are you saying that the libraw api doesn't allow the digiKam raw
> converter programmer ( the person writing the code behind the digiKam
> raw converter - I think that is you, Gilles, yes?),

Yes, i am. Marcel write some code too.

I don't take a look about the gamma curve adjustments. In fact, i
suppose that when i start to implement Raw Import tool in the pass,
these settings have been not yet implemented in libraw. If the purpose
of this settings is exactly what's you need, perhaps we can implement
it in Raw Import tool.

> to give the end
> user (the person actually using the program to decode a raw file) a
> choice of power and toe slope? That the libraw api ONLY lets the
> programmer provide the hard-coded defaults to the end user?


To be sure that we understand exactly libraw gamma curves settings, i
CC Alex who is libraw lead developper.

Alex, please take a look at this mailing list archive and give us your
comments and tips. Thanks in advance

http://digikam.1695700.n4.nabble.com/digiKam-raw-converter-default-gamma-curve-td3325122.html

Gilles

>
> The reason I am asking, is all my camera input profiles use a true
> gamma curve of either 1 (linear gamma) or 2.2. So the respective
> gamm[6] toe-slope value needs to be 0. I don't mind altering the
> libkdcrw source code and recompiling libkdcraw for my own personal
> use.
>
> But if the programmer gave the end-user access to setting their own
> power and toe-slope, like dcraw and UFRaw do, it would be really much
> nicer.
>
> Elle
>
> On 2/28/11, Gilles Caulier <caulier.gilles at gmail.com> wrote:
>> The gamma curve is computed automatically by libraw. Ther is no tune
>> available from libraw api to adjust curve.
>>
>> Only some gamma adjustments are possible from libraw, not a fulll curve.
>>
>> This is why; i added a full curve correction in post processing
>> settings. There is 2 way to use it :
>>
>> - let's post processing computed by libraw to adjust gamma
>> automatically, and process fine adjustment from digiKam postprocessing
>> curves.
>> - disable libraw gamma processing and adjust whole gamma curve from
>> digiKam post processing.
>>
>> Gilles Caulier
>>
>> 2011/2/27 Pentti Rautio <pentti.j.rautio at googlemail.com>:
>>> Hi Elle, hope that you tell what are your conclusions about gamma
>>> correction (when and where and how?)
>>>
>>> By the way : could there be a manufacturer specific correction
>>> somewhere in the code so for example nikon NEF uses a "nikonian" gamma
>>> etc.
>>>
>>> Pentti
>>>
>>> 2011/2/26 Elle Stone <l.elle.stone at gmail.com>:
>>>> Never mind, kfind and geany to the rescue. I found the code section.
>>>> Elle
>>>> _______________________________________________
>>>> Digikam-users mailing list
>>>> Digikam-users at kde.org
>>>> https://mail.kde.org/mailman/listinfo/digikam-users
>>>>
>>> _______________________________________________
>>> Digikam-users mailing list
>>> Digikam-users at kde.org
>>> https://mail.kde.org/mailman/listinfo/digikam-users
>>>
>> _______________________________________________
>> Digikam-users mailing list
>> Digikam-users at kde.org
>> https://mail.kde.org/mailman/listinfo/digikam-users
>>
> _______________________________________________
> Digikam-users mailing list
> Digikam-users at kde.org
> https://mail.kde.org/mailman/listinfo/digikam-users
>



More information about the Digikam-users mailing list