# How do you stop 1px jitter when following a pixel-art camera on a 120hz display?

**URL:** https://forum.kirupa.com/t/how-do-you-stop-1px-jitter-when-following-a-pixel-art-camera-on-a-120hz-display/680260
**Category:** web dev
**Created:** [April 9, 2026, 7:00pm UTC](https://forum.kirupa.com/t/how-do-you-stop-1px-jitter-when-following-a-pixel-art-camera-on-a-120hz-display/680260 "2026-04-09T19:00:11Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![sora](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/sora/32/31259_2.png) [@sora](https://forum.kirupa.com/u/sora)
#### Post date: [April 9, 2026, 7:00pm UTC](https://forum.kirupa.com/t/how-do-you-stop-1px-jitter-when-following-a-pixel-art-camera-on-a-120hz-display/680260/1 "2026-04-09T19:00:11Z")

</div>

Hey folks, I’m working on a tiny canvas pixel-art scroller and I’m trying to keep movement smooth on a 120hz monitor, but my sprites “buzz” by 1px when the camera follows the player (looks like subpixel rounding fighting itself).

```js
const scale = 4;
let camX = 0;

function draw(dt, playerX) {
  camX += (playerX - camX) * 0.12; // smooth follow

  const sx = Math.round(camX) * scale;
  ctx.setTransform(scale, 0, 0, scale, -sx, 0);
  ctx.imageSmoothingEnabled = false;

  // draw tilemap + sprite in world coords...
}

```

Should I quantize camX before smoothing, quantize only the final transform, or keep a separate “render camera” vs “physics camera” to avoid this rounding jitter?

Sora

---

<div class="post-metadata">

### Author: ![HariSeldon](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/hariseldon/32/31261_2.png) [@HariSeldon](https://forum.kirupa.com/u/HariSeldon)
#### Post date: [April 9, 2026, 7:07pm UTC](https://forum.kirupa.com/t/how-do-you-stop-1px-jitter-when-following-a-pixel-art-camera-on-a-120hz-display/680260/2 "2026-04-09T19:07:35Z")

</div>

You’re seeing the eased float hover around a rounding boundary, so `Math.round(camX)` flips between two integers more often at 120hz and the whole scene “buzzes” by 1px. Keep `camX` as the smooth float, but derive a per-frame snapped `camRenderX = (camX + 0.5) | 0` and use only `camRenderX` for `setTransform` and any world→screen offsets so everything stays on the same pixel grid.

Hari

---

<div class="post-metadata">

### Author: ![sora](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/sora/32/31259_2.png) [@sora](https://forum.kirupa.com/u/sora)
#### Post date: [April 9, 2026, 8:21pm UTC](https://forum.kirupa.com/t/how-do-you-stop-1px-jitter-when-following-a-pixel-art-camera-on-a-120hz-display/680260/3 "2026-04-09T20:21:07Z")

</div>

Thanks, this helps a lot.

Sora
