Solitaire Effect GIF
Create animated GIF of the classic Windows Solitaire win card cascade effect. Customize colors, speed, canvas size, and download the GIF instantly.
About
The Windows Solitaire victory cascade is one of computing's most recognizable animations. Cards launch from the tableau and bounce across the screen, leaving persistent color trails that gradually fill the viewport. Recreating this effect requires precise Euler integration of ballistic trajectories - each card follows a parabolic arc under gravitational acceleration g = 9.8 m/s2 (scaled to pixel space), with horizontal velocity vx held constant and vertical velocity vy incremented per frame. On boundary collision, vy is negated and multiplied by a restitution coefficient e ≈ 0.85 to model energy loss. The persistent trail - the signature visual - is achieved by stamping the card's rendered state onto a background buffer at each physics step without clearing the canvas.
Encoding this animation into a GIF file is non-trivial. The GIF89a format requires LZW compression of indexed-color image data, meaning each full-color canvas frame must first be quantized to a 256-color palette. This tool performs median-cut color quantization and full LZW encoding entirely in the browser via a Web Worker. No server round-trips. No external services. Limitations: GIF is capped at 256 colors per frame, so subtle gradients may exhibit banding. Output file sizes scale quadratically with canvas dimensions - a 400×300 canvas at 60 frames produces files of approximately 1 - 4 MB.
Formulas
Each card's position is updated per frame using discrete Euler integration:
Bounce condition: when y + h ≥ H (canvas height), the vertical velocity reverses with energy loss:
Where x, y are card position in pixels, vx is constant horizontal velocity (2 - 5 px/frame), vy is vertical velocity, g is gravitational acceleration in px/frame2, e is coefficient of restitution, h is card height, and H is canvas height.
GIF LZW compression operates on indexed pixel streams. The compressor builds a code table starting from 2minCodeSize + 2 entries (palette indices plus CLEAR and EOI codes). Variable-length codes grow from minCodeSize + 1 bits up to a maximum of 12 bits. When the table reaches 4096 entries, a CLEAR code resets the table.
Reference Data
| Parameter | Default | Range | Effect |
|---|---|---|---|
| Canvas Width | 480 px | 200 - 800 | Horizontal resolution of output GIF |
| Canvas Height | 360 px | 150 - 600 | Vertical resolution of output GIF |
| Card Count | 8 | 1 - 20 | Number of cascading cards |
| Frame Count | 60 | 20 - 120 | Total frames in GIF (duration control) |
| Frame Delay | 50 ms | 20 - 200 | Delay between frames (speed perception) |
| Gravity (g) | 0.5 px/f2 | 0.1 - 2.0 | Downward acceleration per frame |
| Restitution (e) | 0.85 | 0.5 - 0.99 | Energy retained on bounce (1 = perfect elastic) |
| Card Width | 40 px | 20 - 80 | Width of each card rectangle |
| Card Height | 56 px | 28 - 112 | Height of each card rectangle |
| Background Color | #2A7F2A | Any hex color | Classic green felt; customizable |
| Launch Interval | 4 frames | 1 - 15 | Frames between sequential card launches |
| GIF Color Depth | 256 colors | Fixed | GIF89a maximum palette size |
| LZW Min Code Size | 8 bits | Fixed | Starting code size for LZW compression |
| Max LZW Code Size | 12 bits | Fixed | GIF spec maximum code width |