And here is the Sierpinski triangle as well:
$ gmic 1024,1024,1,1,">x>y?0:y<2?1:xor(j(0,-1),j(-1,-1))" f. "255*j(-w/2+y/2,0)"
And here is the Sierpinski triangle as well:
$ gmic 1024,1024,1,1,">x>y?0:y<2?1:xor(j(0,-1),j(-1,-1))" f. "255*j(-w/2+y/2,0)"
@jayprich I like that one liner. Reminds me of my own code called Perspective Streak, and that has it own way of doing that.
Reviving this for the end of the year:
gmic sp car +b 0.5% l. g. xy sign g.. x,-1 g. y,-1 abs compose_channels add add boxfilter 3 endl mul
Elephant textures!
Spring is upon us. Green blossoms forth.
gmic repeat 90 256,256,1,2 f. 'ak=$<*0.008726646;if(c==0,cos(ak)*x+sin(ak)*y,cos(ak)*y+sin(ak)*x)' +compose_channels. and +compose_channels.. xor -compose_channels... or a[-3--1] c to_rgb. f. 'rot(vector3(0,1,1),2*$>+1)*I' n 0,255 done rm. animate 60
spring.mkv (135.1 KB)
Disappointed that the animation stopped rather abruptly, only to repeat itself. The outside is both cold and warm. Hope the transition doesnât take too long.
Useful observation. It is abrupt. A bit like a long-drop hanging. Plan to take another whack at this next time I visit the related tutorial. Cheers, thank you for the remarks!
Nice colours - like the sense of budding & expansion.
Here is my go at a hot summer vibe with wet grass. No daisys.
gmic v - "600,400,1,3,[1.001*x-.5,y+sin(x+.4*y),(300-y)*sin(.2*y)]" circle 20,70,110,1,501,130 w do wait 100 +b 1 warp. .. rm.. w. while "{*}&&!{*,ESC}"
@afre is right on my effort: the cutoff is brutal. The heart, soul and humor of animation - everything - comes down to timing. I need to visit this, one fine day, when there is nothing to do - sometime mid-century, perhaps.
Got a bit of free time this afternoon, the occasion to revive this thread
Here is a new one-liner proposal, written here for bash:
$ gmic v - do 300,300,1,3,"begin(R=rot(10*sin((t=$|)%)));Z=80+40*cos(x/230+2*t)*sin(y/50+4*t);P=R*(Z+100)*([x,y]-[w,h]/2)%;(0.4+exp(-Z/60))*(P[0]<-100?[0,0,255]:P[0]<100?[255,255,255]:[255,0,0])*lerp(0.5,1,xor(P[0]%64,P[1]%64)/64)" w. 200%,200%,0 rm. wait 20 while "{*}"
which displays this little animation:
Here is the âunrolledâ version to be put in a .gmic file:
french_flag :
do
300,300,1,3,"
const t = "$|";
begin(R = rot(10*sin(t°)));
Z = 80 + 40*cos(x/230 + 2*t)*sin(y/50 + 4*t);
P = R*(Z + 100)*([x,y] - [w,h]/2)%;
(0.4+exp(-Z/60))*(P[0]<-100?[0,0,255]:P[0]<100?[255,255,255]:[255,0,0])*
lerp(0.5,1,xor(P[0]%64,P[1]%64)/64)"
w. 200%,200%,0 rm. wait 20
while {*}
Liberté, égalité et fraternité !
Liberty and equality at France?
Liberty, equality and brotherhood.
gmic 512,1,1,1 '(37,17)' eval. 'i(#0,i(x))=1' k.. ifft. a[-2,-1] c n. 0,{2*w#0-16} +. 8 {2*w#0},{2*w#0},1,1 permute.. cyzx eval. ">begin(PV=crop(#0);polygon(#-1,-s#0,PV,1,0xffffffff,255))" k. expand_xy. 4 dilate_circ 4 r2dx 50%,5
rose_37-17.png
rose_19-13-7.png
rose_11-7-3.png
rose_11-7-5.png
(37,3).
Suggest that these numbers should be no larger than 10% of the width and should not have common factors. (16,8,4
) is (4,2,1)
in disguise. Order does not matter: (7,5,3)
paints the same rose as (5,3,7)
Hereâs a command file version:
roses :
$=a
{$a1/2},1,1,1
repeat $#-1,j
=. 1,${a{$j+2}},0,0,0
done
s. c
-ifft.
a[-2,-1] c
n. 0,{2*w#0-16}
+. 8
{2*w#0},{2*w#0},1,1
permute.. cyzx
eval. ">begin(PV=crop(#0);polygon(#-1,-s#0,PV,1,0xffffffff,255))"
k.
Try:
gmic roses.gmic roses 4096,37,3 expand_xy. 4 dilate_circ 4 r2dx 50%,5 o. rose_37-7.png
For the first example drawn large. With the command version, the first argument sets the image size, an arbitrary number of shaping numbers follow. Same guidelines apply.
I have a vague notion that something like this was written a long time ago. I canât find it. @David_Tschumperleâs Hypotrochoid has some resemblance of what is going on here, but whatâs going on here is not circles rolling within/without circles. The shaping numbers are spectral coefficients. Temporally Fourier transformed and circular plotted: real provide the x
coordinate and imaginary provides the y
. Might trace one by happenstance.
What does the $#_-1,j
mean?
Note to self: Look at my gmic file for similar confusing syntax.
Adding Custom Commands is your friend.
"$#
is substituted by the maximum index of known arguments (either specified by the user or set to a default value in the custom command)."
$#
includes the command name in its count, so less one to shorten the iteration to just the arguments following the command line. j
is a local variable that aliases $>
. See repeat ⊠done.
Ah, that makes sense now. I use narg($*)
instead since itâs a bit more obvious of what it says (n = number, and arg means argument)
, and thereâs a syntax difference involved being outside math parser and inside it. I will explore $#
then.
There are so many of those that I forget to use themâŠ
Bonjour,
I really like the rendering of your command line from your message One-liner challenge - #54 by afre
It is necessary to replace the character â by " so that this line of commands also works under GMIC CLI, GMIC-QT, GMIC-GIMP Windows
It will also work on Linux.
Thank you :o)
gmic 512,1,1,1 "(37,17)" eval. "i(#0,i(x))=1" k.. ifft. a[-2,-1] c n. 0,{2*w#0-16} +. 8 {2*w#0},{2*w#0},1,1 permute.. cyzx eval. ">begin(PV=crop(#0);polygon(#-1,-s#0,PV,1,0xffffffff,255))" k. expand_xy. 4 dilate_circ 4 r2dx 50%,5