One-liner challenge

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

3 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

I’m just gonna share another one liner here -

f "begin(const dc=5;const kern=dc*2+1;);N=crop(x-dc,y-dc,0,c,kern,kern,1,1,1);if(i<200,i>avg(N)?max(N):min(N);,i);"

Based off this idea - Majority Color Effect (ymd:100726) - Plugins - Publishing ONLY! - paint.net Forum

Can’t say I was successful, but I got a interesting effect.

Result like this?

Yes. It’s kind of a mix between erode and dilate filter. I made another version which is a extended version of one of MadJik’s Paint.NET filter, but that would be offtopic since it’s not a one-liner anymore.

Another to start the year (obviously insert gmic <image input>):

f "begin(const N=1);V=sort(crop(x-N,y-N,0,c,2*N+1,2*N+1,1,1));find(V,i)*i" quantize 2

apples

Also try swapping the quantize 2 for other things, such as quantize 8,1,1 or otsu 256

5 Likes

Similar to some of mine but much more disciplined. :stuck_out_tongue:

One-liner revival !

$ gmic 729,729,1,3,"c(x,y,l) = (S = round(w/3^l); (int(x/S)%3)*(int(y/S)%3)==1?255:l<6?c(x,y,l + 1):0); c(x,y,1)"

This ones generates a Sierpinsky Carpet using the math evaluator of G’MIC.

The smart thing here is to be able to simulate a recursive call to a custom “function” c(x,y,l).
Normally this is not possible to do recursive calls in the math evaluator, as such functions are actually “macros” rather than “functions” (in particular, the math evaluator does not have a calling stack to push/pop arguments of functions).

Here, as the number of recursions is finite and is always the same for each pixel, I pass a “level of recursion” argument l to the macro c(x,y,l). As l is a constant value, the math compiler is able to generate a corresponding “unrolled” math expression by itself.

A bit complicated to explain, but believe me, this is really tricky :slight_smile:

4 Likes