Stumbled upon “Pixelitor” today : Pixelitor 4.3.0
One of the effects displayed on their web page caught my eye : Photo Collage
So I’ve tried to recreate it in G’MIC somehow :
foo :
foreach { nm={n}
to_rgb
.
100%,100% noise_poissondisk. 20%
0 eval.. "i?(
r1 = u(150,200)/2;
r2 = u(150,200)/2;
pts = mul(rot(u(2*pi)),[ -r1,r1,r1,-r1, -r2,-r2,r2,r2 ],4) + [ x,x,x,x,y,y,y,y ];
da_push([ pts[0],pts[4],pts[1],pts[5],pts[2],pts[6],pts[3],pts[7] ]);
)" da_freeze. rm..
1,100%,1,1,u rv[-2,-1] a[-2,-1] x sort. +,y columns. 1
repeat h {
x0,y0,x1,y1,x2,y2,x3,y3:=I[$>]
xm,xM,ym,yM:=floor(min($x0,$x1,$x2,$x3)),ceil(max($x0,$x1,$x2,$x3)),floor(min($y0,$y1,$y2,$y3)),ceil(max($y0,$y1,$y2,$y3))
+z[0] $xm,$ym,$xM,$yM
r2dx. 200%,1
100%,100% polygon. 4,{2*[$x0-$xm,$y0-$ym,$x1-$xm,$y1-$ym,$x2-$xm,$y2-$ym,$x3-$xm,$y3-$ym]},1,1
N=25
frame[-2,-1] $N,$N,0,0,0,0
f.. "i(#-1)?I:[255,255,255]" dilate_circ. $N
*.. . +shift. 10,10 b. 5 n. 0,0.5 max[-2,-1] r2dx[-2,-1] 50%
j[1] ..,{[$xm,$ym]-$N/2},0,0,1,. rm[-2,-1]
}
k[1] => $nm
}
Not exactly the same but close enough :
$ gmic sp colorful foo
I wonder if this could make a good filter for G’MIC-Qt. Not really happy with the current code (it is quite slow), so maybe I’ll choose another route for doing the effect.
What do you think?