StealThis .dev

Pixel Image

Image that assembles from scattered pixels or reveals pixel-by-pixel on click, using canvas for dynamic pixel manipulation.

Open in Lab
css javascript canvas vue svelte
Targets: TS JS HTML React Vue Svelte

Code

Pixel Image

A stunning pixel assembly animation where an image materializes from randomly scattered pixels that fly into their correct positions. Click to scatter and reassemble.

How it works

  1. An image is loaded and drawn onto a hidden canvas to extract pixel data
  2. Each pixel (sampled at intervals for performance) is assigned a random scattered position
  3. On trigger, pixels animate from scattered positions to their original coordinates using easing
  4. The reverse scatters them again with physics-like motion

Customization

  • src — any image URL (loaded via canvas)
  • pixelSize — sampling resolution (larger = fewer pixels, faster)
  • animationDuration — time for full assembly
  • Trigger mode: on mount, on click, or on scroll

When to use it

  • Portfolio hero images
  • Product reveals
  • Interactive art installations
  • Loading state transitions