Closed asmigala closed 5 years ago
This is pretty neat. However, there's a couple things I'd like to change:
--effect-vignette 10:100
, it could turn that into roughly 0.1:0.9
by doing something like b = base / (base + factor); f = factor / (base + factor);
. I don't know if that makes mathematical sense; it seems to get fairly ok results from playing around with it, but feel free to choose a different normalization scheme if you want.I mean, being able to produce images like this by choosing unintended values is really cool, but maybe not the intended use of this effect:
Sorry about the spaces, will fix.
When it comes to the normalization, the effect you shown is really not intended, but not sure how to fix it a usable way - your suggestion would give the same result for 0.1:0.2
and 0.2:0.4
, which are very different as it's currently implemented.
Would you be ok with simply clamping the resulting vignette_factor
to a value between 0 and 1? We could also clamp each of the parameters separately, e.g. make sure base
is in the 0..1
range and factor
is in (1-base)..1
range. That would probably give a nicer result (no hard edges).
I see what you mean. Yeah, just clamping base to 0..1
and factor to (1-base)..1
is probably the best solution, both for the visual reasons you cite and because it wouldn't slow down the tight inner loop.
Adds a simple vignette effect (darkens the borders of the image).
There are two parameters,
base
andfactor
, both are in the range 0-1,base
specifies how dark is the darkest part of the image andfactor
specifies how much brighter is the brightest part, so e.g.0.2:0.6
will cause the borders to be 0.2 times darker than the original image, while the center will be 0.8 times darker.Not sure about the names of the parameters.
Can also be used as a simple darken effect if the factor is specified as 0.