If we remove the negative uniform by propagating it into mix, things go from:
a(1 - x) + bx // definition of mix
to:
a(1 + x) - bx
<=> a + ax - bx
<=> a + (a - b)x
<=> a - (b - a)x // a - b is counterintuitive since in context, it'd be a negative delta. See code below
Which gives an interpretation of vibrance as a function of the original color, minus the deltas (max - self) and (max - average).
I was wondering if this is a bit more intuitive. Or at least, it surfaces a curious mx^2 if we expand amt for some reason. The parallel with saturation's mix is lost though.
Hello @RedQueenCoder! Followed your blog post http://redqueengraphics.com/2018/08/24/metal-shaders-vibrance/ to here =)
The negative vibrance uniform and the linear interpolation threw me off a bit: https://github.com/BradLarson/GPUImage3/blob/222868e1ba4137a9934b2135635783ef7083eb4d/framework/Source/Operations/Vibrance.metal#L19-L20
If we remove the negative uniform by propagating it into
mix
, things go from:to:
In the context of the code:
Which gives an interpretation of vibrance as a function of the original color, minus the deltas (max - self) and (max - average).
I was wondering if this is a bit more intuitive. Or at least, it surfaces a curious
mx^2
if we expandamt
for some reason. The parallel with saturation'smix
is lost though.Feel free to close if not!