Incredible stuff, David. Had to stop watching, though; my brain was getting foggy. lololol ![]()
I played around with the Hilbert curve a bit and made this little animation with G’MIC (the source code follows).
I think it’s simple but cool!

Source code (40 lines of code
):
# Generate an animation that draws the Hilbert curve.
anim_hilbert :
# Precompute Hilbert curve.
0 eval "
const n = 3 + 1;
const N = 1<<n;
repeat (N^2,d,
for (x = y = 0; t = d; s = 1, s<N, s<<=1,
rx = 1&(t>>1); ry = 1&xor(t,rx);
!ry?(rx==1?(x = s - 1 - x; y = s - 1 - y); swap(x,y));
x+=s*rx; y+=s*ry; t>>=2;
);
da_push([x,y]);
); da_freeze()" => pts
r. 1,{h*5},1,2,5 b. y,0.1% n. -0.5,0.5
# Generate frames for curve generation.
repeat {pts,h} {
+rows[pts] 0,$> 600,600
eval.. "
begin(
const zoom = lerp(15,0.7,$%^0.15);
const fact = 0.95*w#-1*zoom;
angle = lerp(0,360*4,$%)°;
R = rot(angle);
Pc = I[-1,2];
);
pP = J[-1,1]; P = I;
pP = Pc + R*(pP - Pc); P = Pc + R*(P - Pc);
Off = lerp(Pc,0,$%^10); pP-=Off; P-=Off;
polygon(#-1,2,round(w#-1/2 + pP*fact),round(w#-1/2 + P*fact),1,1)"
dilate_circ. {lerp(60,5,$%^0.25)}
+b. {lerp(8,0.5,$%^0.25)}%,3 *. 600 c. 0,255
*.. 255 to_rgb.. map. hot
max[-2,-1]
r. 500,500,1,3,0,0,0.5,0.5
w. wait 10
rs. 50% on. frame.jpg,$>
rm[-2,-1]
}
Amazing ! ![]()
Here is a small animation I’ve made, inspired by the Diffusion-Limited Aggregation (DLA) process, revisited and generated with a short G’MIC script (24 lines
).
What do you think?
Result:
Source code:
# Generate a rotating DLA-like pattern.
anim_dla :
1024,1024 noise 0.001,2 != 0
repeat 2000 {
+> 0.45 distance. 1 b. 1 g. xy,6 a[-2--1] c orientation.
4000,1,1,1,":
do (x = v(w#-2 - 1); y = v(h#-2 - 1), i(#-2,x,y)); # Pick random point
repeat (w#-2,k,
G = I(#-1,x,y,0,1);
dl = 1/max(abs(G));
nx = x - dl*G[0];
ny = y - dl*G[1];
i(#-2,round(nx),round(ny))?break();
x = nx; y = ny;
);
i(#-2,x,y) = 1"
rm[-2,-1]
# Render frame.
+b. 2,3 *. 800 c. 0,255 map. curl
w. rm.
rotate 2,1,0,50%,50% zoom 0.97
}
Tonight, I wanted to test a 3D variant of this pseudo DLA algorithm in 3D, and it turned out to be easier than what I thought. The idea is still to follow the gradient of the distance function, starting from a random point, until it crosses an existing pixel.
The code below generates this 3D mesh, that can be easily exported to Blender afterwards, using Wavefront .obj format. Beware, it takes a bit of time to achieve!
Source code:
foo :
200,200,200 =. 1,50%,50%,50% => img
e ""
repeat 70 {
e "\r - Iteration "{1+$>}/{1+$>+$<}". "
+distance[img] 1 g. xyz,6 a[-3--1] c orientation. => U
300,1,1,1,":
do (X = v([ w#$img,h#$img,d#$img ] - 1), i(#$img,X));
is_found = 0;
repeat (w#$img,
U = I(#$U,X,1);
nX = X - U/max(1e-8,abs(U));
inX = round(nX);
i(#$img,inX)?(is_found = 1; break());
X = nX;
);
is_found?(
iX = round(X);
i(#$img,iX) = 1;
)" rm[U,-1]
}
autocrop 0 b 1,0 isosurface3d 0.1 rv3d
Import in Blender:
I am starting to develop an interactive demonstrator for facial analysis using neural networks, using G’MIC, and for this demonstrator, I want a slightly steampunk look overall.
So I started developing a G’MIC command that generates a circular gauge with a dial and a rotating hand. The demonstrator is not yet finished of course, but I wanted to share this little animation I’ve done, that confirms the jauge is rendering as expected!
This jauge will be used to display various face attributes (like Attractiveness, Age, Glasses, Baldness, etc.). My hope is that this Steampunk look will attract people when this demonstrator is used at the laboratory’s booth during exhibitions or science festivals.
What do you think?
EDIT:
It’s taking shape!
I’ve been able to train a small neural classifier for face detection, and integrated it into the interface. I’ve also added some aging effect to the video on the left panel.
Things are progressing well as I want them to, which is satisfying!
Another iteration, where I added the output of some of the neural network layers. This shows what convolutionnal filters the face detector network has learnt, and what is their effects on the input image.
I think the “Face detector” part is almost ready as it is.
Next step is adding the “Face analysis” part, that will display what characteristics of the face are detected, with the associated probability.
Played with face detection a long time ago for culling photos. Fun stuff. As well, I have recently included gauges in a report. So, I can related to this.
A to-do for me or someone would be to make a filter that generates various types of charts. I know other mathematical tools already do this, but why not in G’MIC as well?
