G'MIC exercises

exercise

#145

@David_Tschumperle I just signed up at GitHub as afr-e. I waited too long; someone took afre. :blush:

Yes, looks like something people actually use. Looks simple but as usual the math and programming will take me a while to digest.

Are you saying that I could apply this principle to @garagecoder filter? If so, I will take a look when I have the time.

As mentioned, the current issue that I am having with Luijk’s curve is that I am getting a kink when a ≠ b. Also, the overall curve isn’t as smooth as I would like it. Maybe I am just stuck on appearances and it isn’t a big deal once I apply it to a real image.


(Alan Gibson) #146

I mis-spoke. I should have said:

The curves passses through (0.5,0.5), and that is where the inflection is. If you want a curve to pass through (a,b) instead, simply raise to the power [log(b)/log(a)].

Of course, raising it to a power will disturb the gradients at the ends, so they become non-zero.

I’ve implemented the family of smoothstep curves in IM. I will document that in my Clut Cookbook.

Personally, the curve I use most often combines IM’s “-sigmoidal-contrast” to adjust mid-tone contrast with a power curve to adjust the mean.

We can use whatever curve suits our purpose, which for me boils down to how I want to control it. I readily view an image in terms of lightness and contrast – mean and standard deviation – so I like those controls. I don’t think in terms of “I want this shade to become that shade, so the curve should pass through (a,b), so that is pow[log(b)/log(a)]”.