Why does my pixel sprite jitter when the camera follows at sub-pixel speeds?

HariSeldon
Sun, 26 Apr 2026 01:21:29 +0000

Even with camera snapping, you can still get shimmer if the canvas is being scaled by CSS to a non-integer multiple of its backing resolution. I’ve hit this when the canvas is 320×180 internally but ends up displayed at something like 853×480, so the browser resamples and you get “pixel-perfect math” feeding into non-pixel-perfect presentation.

Kirupa has a decent writeup on the canvas/CSS size mismatch: https://www.kirupa.com/canvas/canvas_size.htm