A Port of Darktable to the GPU. A Dev Diary

That’s nice! How did you implement it? I have been thinking that it had been real nice to just paint the adjustment ev value directly without a mask!

Internally, it’s a 50% grey surface, and you draw with a black and white pen. The surface itself is hidden, but passed to the shader as an exposure adjustment.

I’m still experimenting with different mappings of black-to-white, to exposure changes. Shifting the value range from 0-1 to 0.5-1.5, and raising it to some power seems to work well as an exposure multiplier. But I’ll play around with it a bit. Something log-scale (i.e. 0.5-2.0 raised to some power) might work better.

vkdt had that for some time too. works well with guided filters: vkdt: draw: raster masks as brush strokes and supports pressure if you have a pentablet.

2 Likes

Oh, that’s a great idea! Thank you!

Maybe try mapping your [0-1] to [-1, 1] and then use it AS the power.
With p for pixel value and s for strength, painted as you described with 0.5 as default value:

out = p * 2 ^ (2 * s - 1)

Then you get the log-behavior easily :slight_smile: That is at least how I have been thinking about doing it! The maximum effect can easily be adjusted by either scaling the exponent range or base size.