poulette icon indicating copy to clipboard operation
poulette copied to clipboard

alternative blending algorithms

Open micouy opened this issue 3 years ago • 6 comments

very cool project. it inspired me to experiment with different blending algorithms. i created something similar in p5.js, have a look here.

in one version i just calculate a coefficient (1 / distance)^power for each point at each pixel and the resulting color is a sum of point_color * normalize(point_coeff). normalize prevents the sum of coefficients from being greater than 1.

in the second version the resulting color is something like a sum of point_color * normalize(sum_of_coeffs - point_coeff). you can drag points, pick a color by clicking anywhere (the output is in the console) and add a new point by double-clicking.

one-over:

one over

subtract:

subtract

micouy avatar Apr 02 '21 13:04 micouy

i tried to model the transitions in geogebra but they don't behave exactly like i expected them to: https://www.geogebra.org/3d/wws3s4yh

micouy avatar Apr 02 '21 13:04 micouy

You version is gorgeous and the geogebra visualization is super interesting! I'll try some variations on the blending method and the color space some day. It seems I'll have to abandon the WebGL implementation and its triangles-based blending at some point...

grgrdvrt avatar Apr 05 '21 16:04 grgrdvrt

thanks! here's a cool effect i managed to recreate (-ish). i think this was the one-over version, it creates these sharp edges when you move the slider to the right and the distance between two source points is small.

image image

micouy avatar Apr 06 '21 08:04 micouy

also made me think of this https://meshgradient.com/

dackdel avatar Apr 09 '21 09:04 dackdel

WOW! it's so cool. do you have any idea how it works? i can't find anything about their algorithm but i saw that photoshop has a similar tool.

EDIT: someone implemented it in shadertoy https://www.shadertoy.com/view/7sSGzh

micouy avatar Apr 09 '21 09:04 micouy

no idea unfortunately. the shadertoy link is que cool

dackdel avatar Apr 09 '21 14:04 dackdel