# img-auto-parallax

> Swap an img tag for this web component and a photo gains a 3D parallax effect, with depth worked out on the visitor's device.

Canonical page: https://sitepeel.dev/resources/img-auto-parallax/

Website: https://img-auto-parallax.vercel.app/

Category: Visual effects. Access: Open source.

## What it is

A web component by Anthony Fu. It runs a small depth model in the browser on WebGPU to guess which parts of a photo are near or far, then moves the layers as the pointer, scroll or phone tilt changes. The playground lets you try your own photo, choose a model and resolution, and set strength, smoothing and focus blur, and you can also precompute depth maps at build time.

## Is it for you?

- Made for: Front-end developers who want photos on a site to feel more alive without making 3D assets.
- You need: Any web page (works with Vue, React or plain HTML). WebGPU for live depth, or a precomputed depth map for WebGL
- Price: Open source (MIT)

## What you can do with it

- Hero photos that move with the mouse
- Gallery images that react to phone tilt
- Adding depth to travel or portfolio photos
- Precomputing depth maps for faster pages

Good to know: Running the depth model in the browser downloads 5 to 67 MB depending on the model.

## More like this

- [Rustorizer](https://sitepeel.dev/resources/rustorizer/index.md): Image-to-SVG converter written in Rust that traces true circles, sharp lines and gradients from PNG, JPEG or WebP, all on your machine.
- [koipond](https://sitepeel.dev/resources/koipond/index.md): Koi fish that swim through realistic WebGL water as one React component. Visitors can glide over the water, tap it and feed the fish.
- [PRO Threads](https://sitepeel.dev/resources/pro-threads/index.md): Animated wallpaper where letters are made of streaks of light, with controls for text, colors and motion and a PNG save.

All resources: https://sitepeel.dev/resources/index.md. Checked on 2026-12-05.
