/Gallery Web demo All effects ← Site

Amber Laboratory

Bubbles rise through a warm flask.

Astra Kinetic · every moving shape in it is evaluated by the rule, not drawn · 256×192 grid · 48-step seamless loop

Amber Laboratory — animated pixel art loop generated in Phluxel
One painted still, one rule, 48 steps. Every frame above came out of the simulation.

The rule that makes it move

This is the whole thing. Phluxel runs it on every cell, every step — the animation is what happens when you repeat it. BASE is the painted scene, so the rule reads the artwork instead of its own output and never smears.

Amber LaboratoryPhlux
// Astra scene. _sx/_sy rescale the 256x192 coordinates to any grid size.
PARAM _motion=1
LET _sx = 256/GW
LET _sy = 192/GH
LET _p={FRAC,TICK*_motion/48}
LET _t=_p*6.283185307179586
LET _r=BASE.R
LET _g=BASE.G
LET _b=BASE.B
LET _bp0={FRAC,_p+0.0}
LET _bx0=102+3*{SIN,_t+0}
LET _by0=133-49*_bp0
LET _m1=((X*_sx-(_bx0))*(X*_sx-(_bx0))+(Y*_sy-(_by0))*(Y*_sy-(_by0))<4) ? 1 : 0
LET _r1=_m1 ? 234 : _r
LET _g1=_m1 ? 210 : _g
LET _b1=_m1 ? 146 : _b
LET _bp1={FRAC,_p+0.1111111111111111}
LET _bx1=119+3*{SIN,_t+1}
LET _by1=133-49*_bp1
LET _m2=((X*_sx-(_bx1))*(X*_sx-(_bx1))+(Y*_sy-(_by1))*(Y*_sy-(_by1))<9) ? 1 : 0
LET _r2=_m2 ? 234 : _r1
LET _g2=_m2 ? 210 : _g1
LET _b2=_m2 ? 146 : _b1
LET _bp2={FRAC,_p+0.2222222222222222}
LET _bx2=136+3*{SIN,_t+2}
LET _by2=133-49*_bp2
LET _m3=((X*_sx-(_bx2))*(X*_sx-(_bx2))+(Y*_sy-(_by2))*(Y*_sy-(_by2))<4) ? 1 : 0
LET _r3=_m3 ? 234 : _r2
LET _g3=_m3 ? 210 : _g2
LET _b3=_m3 ? 146 : _b2
LET _bp3={FRAC,_p+0.3333333333333333}
LET _bx3=153+3*{SIN,_t+3}
LET _by3=133-49*_bp3
LET _m4=((X*_sx-(_bx3))*(X*_sx-(_bx3))+(Y*_sy-(_by3))*(Y*_sy-(_by3))<9) ? 1 : 0
LET _r4=_m4 ? 234 : _r3
LET _g4=_m4 ? 210 : _g3
LET _b4=_m4 ? 146 : _b3
LET _bp4={FRAC,_p+0.4444444444444444}
LET _bx4=102+3*{SIN,_t+4}
LET _by4=133-49*_bp4
LET _m5=((X*_sx-(_bx4))*(X*_sx-(_bx4))+(Y*_sy-(_by4))*(Y*_sy-(_by4))<4) ? 1 : 0
LET _r5=_m5 ? 234 : _r4
LET _g5=_m5 ? 210 : _g4
LET _b5=_m5 ? 146 : _b4
LET _bp5={FRAC,_p+0.5555555555555556}
LET _bx5=119+3*{SIN,_t+5}
LET _by5=133-49*_bp5
LET _m6=((X*_sx-(_bx5))*(X*_sx-(_bx5))+(Y*_sy-(_by5))*(Y*_sy-(_by5))<9) ? 1 : 0
LET _r6=_m6 ? 234 : _r5
LET _g6=_m6 ? 210 : _g5
LET _b6=_m6 ? 146 : _b5
LET _bp6={FRAC,_p+0.6666666666666666}
LET _bx6=136+3*{SIN,_t+6}
LET _by6=133-49*_bp6
LET _m7=((X*_sx-(_bx6))*(X*_sx-(_bx6))+(Y*_sy-(_by6))*(Y*_sy-(_by6))<4) ? 1 : 0
LET _r7=_m7 ? 234 : _r6
LET _g7=_m7 ? 210 : _g6
LET _b7=_m7 ? 146 : _b6
LET _bp7={FRAC,_p+0.7777777777777778}
LET _bx7=153+3*{SIN,_t+7}
LET _by7=133-49*_bp7
LET _m8=((X*_sx-(_bx7))*(X*_sx-(_bx7))+(Y*_sy-(_by7))*(Y*_sy-(_by7))<9) ? 1 : 0
LET _r8=_m8 ? 234 : _r7
LET _g8=_m8 ? 210 : _g7
LET _b8=_m8 ? 146 : _b7
LET _bp8={FRAC,_p+0.8888888888888888}
LET _bx8=102+3*{SIN,_t+8}
LET _by8=133-49*_bp8
LET _m9=((X*_sx-(_bx8))*(X*_sx-(_bx8))+(Y*_sy-(_by8))*(Y*_sy-(_by8))<4) ? 1 : 0
LET _r9=_m9 ? 234 : _r8
LET _g9=_m9 ? 210 : _g8
LET _b9=_m9 ? 146 : _b8
LET _m10=(Y*_sy>133 & Y*_sy<136 & {ABS,X*_sx-128}<13*{ABS,{COS,_t}}+2) ? 1 : 0
LET _r10=_m10 ? 240 : _r9
LET _g10=_m10 ? 223 : _g9
LET _b10=_m10 ? 181 : _b9
A=255
R=_r10
G=_g10
B=_b10

The coordinates are written for the 256×192 canvas this was painted on; _sx/_sy rescale them, so the same rule works on a smaller grid too. Download the script ↓

Make it yourself

  1. Open Phluxel, click Browse Starters and pick Amber Laboratory — that loads the painted scene and this rule together.
  2. Press play, then drag the _motion knob while it runs. You never have to stop and restart.
  3. Paint over the scene, or drop the rule on your own artwork — it reads whatever is underneath.
  4. Export a seamless loop as GIF, APNG, MP4, a PNG sequence, or a sprite sheet.

Try it without installing anything

Phluxel runs in the browser as a demo, and the free desktop edition has every feature with a watermark on exports.

Open the browser demo Download free (Windows) Wishlist on Steam

More from Astra Kinetic

Orbital AtelierA desk orrery swings its planets around the lamp. Courtyard FountainWater arcs from the fountain and falls back into the basin. Analog RotationThe tonearm rides a turning record. Signal StudyA waveform crawls across an oscilloscope screen. All 90 effectsThe complete starter gallery.