Just had some fun tonight with an idea I wanted to experiment. Basically, the script tries to “paint” random brush strokes on a white canvas, in order to get closer and closer to the input image.
Here is the G’MIC script:
paint :
100%,100%,1,3,255
+mse[0,1] mse_best={i[1]} rm.
repeat inf
100%,100% noise. {u(0.3)},2 gt. 0 distance. 1 lt. {u(2,20)}% deform. {u(40)} gt. 0
+label_fg. 0 {iM+1},1,1,3,u(0,255) point. 0,0,0,1,0 map.. . rm.
+blend[0] .,shapeaverage0
blend[-2,-1] alpha,{u(0.5,1)}
distance.. 0 n.. 0,1 pow.. {u(2)} f.. "i?cut(i+u(-0.25,0.25),0,1):i"
+j[1] .,0,0,0,0,{u(0.7)},..
+mse[0,-1] mse={i[1]} rm.
if $mse<$mse_best
j[1] . mse_best=$mse +e $mse_best
to. {round($mse_best)},0.01~,0.01~,4%
w. on. frame.jpg,$>
fi
rm[-3--1]
done
Here is the result (takes a lot of time to render by the way):
What happens when considering only a “solid” brush ?