One-liner challenge

Here is a bash/gmic/ffmpeg combo move:

  • From a dir with images capture000000.jpgcapture000309.jpg
cp capture000000.jpg out000000.jpg ; prev=0 ; previous=0 ; counter=1 ; current=1 ; until [ $counter -gt 309 ] ; do current=$(echo 0000000$counter|tail -c 7) && prev=$((counter-1)) && previous=$(echo 0000000$prev|tail -c 7) && previous=$(echo 0000000$prev|tail -c 7) && gmic capture$(echo $current).jpg out$(echo $previous).jpg blend lighten -o out$(echo $current).jpg && ((counter++)) ; done && ffmpeg -framerate 48  -i out%06d.jpg -vcodec libx264 -s 1280x720 -preset slow -crf 5 -pix_fmt yuv420p  ~/Desktop/startrails1d.mkv

Well that was fun, but I imagine this can be done with a simpler gmic command.

1 Like

Nice. :star:

Yes, gmic could totally do what you did with bash or, in the case of Windows, cmd.

I knew it! Alls I’m doing with bash is a two element accumulating sliding window, and making a 48 fps 720p mkv in ffmpeg.

gmic lights.jpg tic r2dx 750%,2 r2dx 7%,1 r2dx 525,1 chroma_afre .6 autoindex 16,1 toc n 0,255 round o lights.png

I only used resize. chroma_afre isn’t important. I just wanted to match the saturation with @Reptorian’s. With some more tweaking and adjustments, I am sure that @Reptorian can improve his filter.

lights

Resurrecting this thread, with a new “surprise” one-liner I just found tonight:

$ gmic v - chromeball64x64 255,20,0 r2dx. 48 s c,-3 600,600,1,3,"(y*[0,20,100]+(h-y)*[200,100,200])/h" .x9 eval "S = crop(#0); A = crop(#1); for (t = f = 0, 1, t+=0.02, draw(#2+f,S,[268-15*[16*(sin(t)^3),13*cos(t)-5*cos(2*t)-2*cos(3*t)-cos(4*t)],0,0],48,48,1,3,1,A,255); ext('w[',2+f,'] wait 20'); (++f)%=10)"

Do you succeed in running it ? (tested with bash only, I hope this works on the Windows console too!).

I just see an animation with a heart in it.

Isn’t that really cool ? :stuck_out_tongue:

onliner2

2 Likes

@David_Tschumperle

Had a closer look at the balls. It does not look like that on my end. I might do a bug report later this week.

image

Yes, however, there are 2 issues. :nerd_face::stuck_out_tongue:

1 The GIF in your post isn’t a complete loop. A complete loop brings the head of the ball snake around to go from nothing to a complete heart, which I think is the cool part. :sunglasses:

2 The movement of the head ball at the cusps isn’t natural, causing a bouncy effect as it transitions. The reason is it doesn’t go underneath the tail end, breaking the illusion.

PS One more thing I noticed was that when I close the window the gmic interpreter doesn’t end. I have to abort using CTRL+C.

Nice! Worked fine in G’MIC 2.5.3 in Sabayon.

Here’s my one liner

channels 0 f "int(((($5==1?($4?($4==1?((x|int($1))+(y|int($2))):(xor(x,int($1))+xor(y,int($2)))):((x&int($1))+(y&int($2)))):($4?($4==1?((-x|int($1))+(-y|int($2))):(xor(-x,int($1))+xor(-y,int($2)))):((-x&int($1))+(-y&int($2)))))/(int($3)*2))-int(($5==1?($4?($4==1?((x|int($1))+(y|int($2))):(xor(x,int($1))+xor(y,int($2)))):((x&int($1))+(y&int($2)))):($4?($4==1?((-x|int($1))+(-y|int($2))):(xor(-x,int($1))+xor(-y,int($2)))):((-x&int($1))+(-y&int($2)))))/(int($3)*2)))*($5==1?($4?($4==1?((x|int($1))+(y|int($2))):(xor(x,int($1))+xor(y,int($2)))):((x&int($1))+(y&int($2)))):($4?($4==1?((-x|int($1))+(-y|int($2))):(xor(-x,int($1))+xor(-y,int($2)))):((-x&int($1))+(-y&int($2))))))<int($3)?($5==1?($4?($4==1?((x|int($1))+(-y|int($2))):(xor(x,int($1))+xor(-y,int($2)))):((x&int($1))+(-y&int($2)))):($4?($4==1?((x|int($1))+(y|int($2))):(xor(x,int($1))+xor(y,int($2)))):((x&int($1))+(y&int($2))))):($5==1?($4?($4==1?((-x|int($1))+(y|int($2))):(xor(-x,int($1))+xor(y,int($2)))):((-x&int($1))+(y&int($2)))):($4?($4==1?((-x|int($1))+(-y|int($2))):(xor(-x,int($1))+xor(-y,int($2)))):((-x&int($1))+(-y&int($2)))))"

See what you get after doing % 256 or using it as coordinate map.

Not exactly a one-liner. I put it into a command and got:

gmic sample tiger rep_ {[u,u,u,u,u]} % {2^8}

The recommended variables are

$1 = [0,128]
$2 = [0,128]
$3 = [0,180]
$4= 0 for and, 1 for or, 2 for xor
$5= 0,1 are for different styles

Starting point would be 8,8,128,2,0

That would make it:

That is an improvement in the wow factor. :stuck_out_tongue:

1 Like

Here’s my example, also I call the command rep_binaltquadtex

showoff

1 Like