You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
half amt = (mx - average) * (-uniform.vibrance * 3.0);
color.rgb = mix(color.rgb, half3(mx), amt);
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.
Feel free to close if not!
The text was updated successfully, but these errors were encountered:
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:
GPUImage3/framework/Source/Operations/Vibrance.metal
Lines 19 to 20 in 222868e
If we remove the negative uniform by propagating it into
mix
, things go from:to:
In the context of the code:
half amt = (mx - average) * uniform.vibrance * 3.0; color.rgb = color.rgb - (mx - color.rgb) * amt;
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!
The text was updated successfully, but these errors were encountered: