Advertisement
Guest User

G'MIC Rock-Paper-Scissor Animation

a guest
Jun 14th, 2024
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.88 KB | None | 0 0
  1. # Generate 'Water-Paper-Scissors' animation.
  2. water_paper_scissors :
  3.  
  4.   # Generate game iterations as a single volumetric image.
  5.   150,150,150,1,v(2)
  6.   repeat 100 {
  7.     fill "const boundary = 2;
  8.       const threshold = 9;
  9.       winner = (i + 1)%3;
  10.       H = histogram(crop(x - 1,y - 1,z - 1,3,3,3),1,winner,winner);
  11.       H[0]>=threshold?winner:i"
  12.     window.
  13.   }
  14.  
  15.   # Stylize each label of each frame with a water-drop effect.
  16.   resize 480,480,100%,1,6 blur xy,1%,2 cut 0,2 round 1
  17.   +==[0] 1 +==[0] 2 ==[0] 0 normalize 0,255
  18.   foreach { i=$> split z
  19.     col0=0,0,0
  20.     col1=128,0,0
  21.     col2=200,128,32
  22.     foreach {
  23.       channels. -3,0 100%,100%,1,3 fill_color. ${col$i}
  24.       +fx_drop_water 1,20,2,80,0,3,35,10,1,0.5,0.25,0.5,0.75,0.05,0.15,0
  25.       remove.. channels.. 3 split. c remove. move[0] $! append c
  26.       window.
  27.     }
  28.     append z
  29.   }
  30.   blend alpha split z
  31.  
Tags: gmic
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement