Motion Blocks

Canvas

Pixelated Image

OGL image revealer that starts as coarse blocks and sharpens to full resolution over time.

  • lit Preview of https://lit.devLitSimple. Fast. Web Components.
  • ogl Preview of https://github.com/oframe/oglOGLMinimal WebGL framework.

Preview

Animated depixelation reveal that doubles the sampling grid until the image resolves to full detail.
Attributes

Installation

pnpm dlx motion-blocks add pixelated-image

Usage

---import "@/components/motion-blocks/pixelated-image-element.ts";--- <motion-pixelated-image  image="https://picsum.photos/seed/pixelated/800/600"  initial-grid-size="6"  step-duration="0.15"></motion-pixelated-image>

API Reference

Attribute Type Default
image Image source URL used for the depixelation reveal. string ""
initial-grid-size Starting vertical grid size before each depixelation step doubles it. number 6
step-duration Seconds each depixelation step lasts before the grid doubles again. number 0.15