Bash.tv → GitHub → itch.io

Pixel art rendering and sprite conventions for web games. Choosing a base resolution and sprite sizes, integer scaling and letterboxing, nearest-neighbor filtering everywhere (canvas, CSS, WebGL, Phaser, Pixi, three.js), rounding positions and the camera, avoiding blur, seams and shimmering, palettes, outlines and readability, animation frame counts, pixel fonts, UI at the same pixel scale, and...

Download skill (.zip) Files on GitHub

Pixel art development

1. Pick a base resolution (render at it, scale up)

Base Feel Sprites
320×180 Chunky, retro 16×16
384×216 / 426×240 Classic 16-bit 16–32
480×270 / 640×360 Detailed 32×32

16:9 bases scale by whole numbers to 1280×720 (×4 from 320×180), 1920×1080 (×6) and phones.

2. Crisp rendering, everywhere

// draw the game into a small canvas at base resolution, then scale the whole canvas
const low = document.createElement("canvas"); low.width = 320; low.height = 180;
const g = low.getContext("2d"); g.imageSmoothingEnabled = false;            // re-set after any resize
function present() {
  const scale = Math.max(1, Math.floor(Math.min(innerWidth / 320, innerHeight / 180)));   // integer scale
  view.width = 320 * scale; view.height = 180 * scale;                         // (or CSS size with image-rendering: pixelated)
  const v = view.getContext("2d"); v.imageSmoothingEnabled = false; v.drawImage(low, 0, 0, view.width, view.height);
}

CSS: canvas { image-rendering: pixelated; }. Phaser: pixelArt: true, roundPixels: true. Pixi: TextureStyle.defaultOptions.scaleMode = "nearest" and roundPixels: true. three.js: texture.magFilter = texture.minFilter = THREE.NearestFilter.

If integer scaling leaves big borders on phones, allow non-integer scaling for the final blit only (the low-res canvas stays crisp but pixels become slightly uneven), or use the “expand” approach (responsive-game-design) to show more world.

3. No shimmer, no seams

4. Art conventions

5. Making art

Aseprite (paid), LibreSprite / Piskel (free). Free packs: Kenney (CC0), OpenGameArt (check licenses; credit in CREDITS.md). Placeholder art: colored rectangles at the final sprite size, so swapping is painless.