Pixelate is a local Next.js app for turning images and videos into stylized canvas renders. It ships a landing page at / and a full editor at /app.
- Node.js 20 or newer
- npm (use
npm.cmdon Windows PowerShell if execution policy blocksnpm.ps1) - A modern browser with Canvas, MediaRecorder, and
canvas.captureStream()support for video export
npm install
npm run devOpen the local URL printed by Next.js, usually http://localhost:3000. The editor is at http://localhost:3000/app.
Build and start the production app:
npm run build
npm run startOn Windows PowerShell:
npm.cmd run build
npm.cmd run start- Images: PNG, JPG/JPEG, WebP
- Videos: MP4, WebM, Ogg video, MOV/QuickTime
Videos are loaded into a hidden muted looping video element and sampled into the renderer every animation frame.
The app defaults to ASCII. Use the Render mode dropdown in the sidebar to switch to any other mode.
| Mode | Description |
|---|---|
| ASCII | Maps image values to characters with optional color and motion |
| Pixel Blocks | Renders each sampled cell as a square or rounded block |
| Dots | Renders cells as circles with optional brightness-based sizing |
| Mosaic | Renders jittered painterly tiles with tone variation |
| Mode | Description |
|---|---|
| Blurred Image | Draws the source with blur, saturation, and brightness filters |
| Black Silhouette | Thresholds the source into a black silhouette |
| Transparent Image | Clears the canvas alpha and draws the source with optional opacity and blur |
Voronoi diagram, Pointillism, Watercolor, Oil painting, Stippling, Cross hatching, Linocut / woodblock, Risograph, Thermal camera, Infrared, Solarize, Duotone, Halftone CMYK
Voronoi stipple, Flow field, String art, Topographic, Pixel sort, Databend / glitch, Dithering (Floyd-Steinberg, Bayer matrix, ordered, Sierra, Atkinson — color-aware, respects active color mode), Stained glass
Fill shape with text, Emoji mapping, Word cloud, Binary, Matrix rain
Reaction diffusion, Liquid simulation (stable-fluid velocity field used as source-image refraction with wave bands, sliver displacement, caustics, and ripples), Sand simulation, Magnetic field lines, Noise displacement
Character mapping styles
- Brightness ASCII
- Detailed ASCII
- Block characters
- Braille density glyphs
- Directional edge glyphs
- Custom charset
Mapping algorithms
- Perceptual luminance:
0.299R + 0.587G + 0.114B - Standard brightness: average RGB
- HSL lightness
- Sobel edge strength
- Sobel edge direction sketch
- Contrast boosted
Rendering variations
- Match-image colored ASCII
- Single-color ASCII
- Palette-mapped ASCII
- Complementary-color ASCII
- Inverted mapping
- Floyd-Steinberg dithering
- Animated character and palette cycling
All render modes share the same color section:
- Single color
- Match image
- Palette
- Complementary
- Rainbow
- Palette size from 1 to 8 colors
- Per-slot palette color pickers
- Palette animation speed
Every render mode shares the same final output adjustments, applied after the renderer and mouse interaction:
- Brightness
- Saturation
- Hue
- Luminance
- Opacity
These affect the live canvas plus PNG, video, and favicon exports. SVG/React exports carry representable filter and opacity settings.
- Animate mode: animates the active renderer behavior.
- Cycle colors: keeps renderer behavior static but cycles color assignments.
Both work across all color modes (single, source, palette, complementary).
Timeline lets you animate one image through multiple edit states.
- Enable Timeline in the sidebar.
- Set Duration and move the Playhead.
- Add keyframes at different times after changing mode/settings/colors.
- Select, update, or delete keyframes.
- Play/Pause with optional loop to preview interpolated animation.
The canvas renders interpolated state between keyframes, so mode, color, and control changes animate over time.
Mouse interaction is available in every render mode. Cell-based modes move their sampled cells with spring physics. All modes also receive a post-render canvas warp so direct-source and generative modes respond to the pointer.
The Canvas section controls render/export resolution:
- Auto: display size multiplied by device pixel ratio
- 720p / 1080p / 1440p / 2160p: target the short edge, preserving aspect ratio
For example, 1080p on a 16:9 source produces a 1920×1080 canvas; on a 9:16 portrait source it produces 1080×1920.
Higher resolutions make live preview heavier, especially dense ASCII. Use Auto while tuning, then switch before export.
The Canvas section also has a Background toggle. Turn it off for a transparent canvas. PNG exports preserve alpha, and SVG/React exports omit the background rectangle.
| Format | Notes |
|---|---|
| PNG | Saves the current canvas pixels at full backing-store resolution |
| SVG | Exports vector output for cell-based modes |
| React | Opens a modal with a self-contained React component generated from the SVG |
| Video | Records the live canvas for 1–10 seconds using MediaRecorder |
| Favicon | Saves a real .ico file with embedded PNG payloads at 16, 32, 48, 64, 128, and 256 px |
SVG and React exports are only meaningful for cell-based modes. Direct-source and generative modes produce a blank SVG.
app/
layout.tsx — root layout, metadata
page.tsx — landing page
app/page.tsx — editor application
favicon.ico/route.ts — dynamic .ico route
components/
LandingPage.tsx — landing page component
Canvas.tsx — canvas host
Sidebar.tsx — editor sidebar controls
UploadZone.tsx — drag-and-drop / click upload
ExportModal.tsx — export UI
controls/ — shared control primitives
hooks/
useRenderer.ts — canvas sizing, animation loop, media sampling,
mouse physics, output adjustments, render dispatch
lib/
types.ts — AppState and sub-types
defaults.ts — default state values
modes.ts — mode lists and labels
charsets.ts — ASCII charset presets
color.ts — palette and color math helpers
imageData.ts — pixel sampling utilities
export.ts — export helpers (PNG, SVG, React, video, favicon)
timeline.ts — keyframe interpolation
renderers/
index.ts — mode → renderer dispatch
types.ts — RenderContext type
util.ts — shared drawing primitives
background.ts — background fill / clear
color.ts — color mode resolution
sourceColor.ts — source-image color sampling
ascii.ts — ASCII renderer
pixelBlocks.ts — Pixel Blocks renderer
dots.ts — Dots renderer
mosaic.ts — Mosaic renderer
blurred.ts — Blurred Image renderer
black.ts — Black Silhouette renderer
transparent.ts — Transparent Image renderer
effects.ts — all expanded effect / generative / live modes
public/
demos/ — .webm files used by the landing page marquee
.pixelate-memory.mdis intentionally git-ignored and meant for local working notes only.- Running plain
npm run buildmay fail in PowerShell if script execution policy blocksnpm.ps1; usenpm.cmd run buildin that case.
See CONTRIBUTING.md