The source tests passed; the Node/tsx import failed
Our repository run passed all 56 Vitest tests, while a separate version 0.2.1 Node/tsx quickstart stopped at an import error. Use img-auto-parallax for a photo-led page where a still image already does its job and depth is an optional addition. Skip it if the brief requires the same animated effect in browsers without WebGPU: the official documentation describes a plain-image fallback.
The integration decision is where to calculate depth, the estimated distance of each pixel from the viewer. For fixed site photography, a depth map generated before publication avoids browser model loading. For photographs received at runtime, browser estimation provides the other documented route. The installation and precompilation documentation covers both approaches, placing the estimation work either in the asset pipeline or on the visitor's device.
What people use img-auto-parallax for
The project author demonstrates interactive photo depth and a clock placed between background and foreground copies of one photograph in the official playground. These examples show two compositions built around the same depth estimate. One moves the photograph's foreground against its background; the other uses that separation to place ordinary HTML content behind the foreground subject.
| Who used it | What they demonstrated | Outcome described |
|---|---|---|
| The project author | Interactive photograph with depth, parallax and optional focus blur | The photograph gains layered movement, with a plain image as the fallback. |
| The project author | Lock-screen-style photograph and clock | A foreground copy overlaps the clock while the image layers follow pointer movement or phone tilt. |
The photo example combines movement with optional depth-of-field blur. The documentation describes keeping the area under the pointer sharp while other distances blur. That gives the developer separate choices about movement and focus: a photograph can use depth separation without applying blur to details that readers need to inspect. The playground exposes attributes for strength, smoothing, input triggers and idle sway rather than requiring a single fixed presentation.
The clock example uses two copies of the same photograph with content between them. The background layer fills the area behind the subject; the foreground layer draws pixels closer than the selected cutoff. The author also documents a flat bottom layer when both copies should move in lockstep. The composition therefore starts with the photograph and the intended overlap, with HTML supplying the clock and its layout.
What happened when we ran it
Our December 2, 2026 repository run at commit a51b456 passed installation, build and tests. A separate quickstart at commit 6178283a2139 installed npm package version 0.2.1 and executed the README's two-line TypeScript registration block unedited with tsx. That task used npm instead of the README's pnpm installation command, giving the import failure a specific package and execution context.
The quickstart sandbox was an unprivileged lab-node:22 container configured with 2 CPUs, 4 GB RAM, no published ports and no secrets. The task recorded cloning, installation, installed size, dependency count, snippet execution and teardown separately. The table keeps each step's outcome attached to its own record, including the failed registration attempt and successful cleanup.
| Hands-on question | Answer | Verdict | Why |
|---|---|---|---|
| Did the quickstart clone complete? | The clone took 4 seconds. | Completed | The recorded clone step completed. |
| Which npm package did the quickstart install? | img-auto-parallax 0.2.1 installed in 15 seconds. | Completed | The runner used npm install img-auto-parallax@latest; the README recommends pnpm. |
| How large was that quickstart installation? | node_modules occupied 276.1 MB. | Recorded | This figure belongs to the separate npm installation. |
| How many other packages did it install? | 34 packages besides img-auto-parallax. | Recorded | This count belongs to the quickstart dependency step. |
| Did the README registration block run under tsx? | It failed in 0.5 seconds, exiting with code 1 and ERR_PACKAGE_PATH_NOT_EXPORTED. | Failed | The error names a missing exports main in @vgpu/core/package.json. |
| Did sandbox teardown complete? | The teardown record says ok. | Completed | Cleanup has its own successful record. |
The exact quickstart error was Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in /work/qs/node_modules/@vgpu/core/package.json. The recorded snippet-failed finding identifies the same failure. It occurred while tsx executed the registration block, before photograph rendering. The log identifies the package export error; it supplies no successful repair step to follow the failed import.
Our run passed 56 Vitest tests with zero failures in 4 seconds. The repository measurements record a sandbox configured with 3 CPUs, 8 GB RAM and image label lab-node:22. Installation, build time and workspace size describe the source workspace at a51b456. The dependency totals and disk figures describe development installations rather than a browser's asset downloads.
| Repository check | Recorded outcome |
|---|---|
| pnpm install | Succeeded in 17 seconds; 604 dependencies recorded; 640 MB on disk |
| Build | Succeeded in 9 seconds |
| Vitest | Succeeded in 4 seconds; 56 passed, 0 failed of 56 |
| Source scan | 156 files; approximately 8,507 source lines; 55.7 MB checked out |
| Project structure | Monorepo workspaces; 2 CI workflow files; no Dockerfile or tests directory detected |
The source scan found no directory named tests, alongside the passing Vitest suite. A directory-name check and a test-run result answer different questions: the former describes layout, while the latter records executed tests. The repository also had monorepo workspaces and two CI workflow files. Those structure signals sit beside the installation, build and test outcomes rather than replacing them.
Where people get stuck: secure contexts, permissions and stale maps
The README requires HTTPS or localhost for WebGPU and motion events. Over plain HTTP, it says every element renders as a normal image. iOS Safari adds a separate requirement: a user gesture before sharing device motion. These are concrete integration requirements, so the page's serving origin and permission interaction belong beside component registration in a setup checklist.
| Symptom or constraint | Documented response | Expected behavior |
|---|---|---|
| Plain HTTP page | Serve over HTTPS or use localhost | The element renders as a normal image. |
| Browser lacks WebGPU | Retain the image fallback | The ordinary image stays visible. |
| iOS Safari has no motion permission | Tap the image or request permission inside a click handler | Tilt input starts after permission is granted. |
| Live estimation loads a model | Supply a precompiled map for fixed photographs | The browser skips the model, ONNX Runtime and WebAssembly. |
| Photograph changes at the same URL | Change its URL or call refresh() | Map keys include model, resolution and image URL. |
| HTTP cache eviction prevents model reuse | Use the documented optional browser storage | Models can be stored in the Cache API or IndexedDB. |
| Storage is full or unavailable | Allow depth estimation to run again | The element falls back to running the model again. |
| Full-resolution inference is selected | Start with the default model-input resolution | The docs describe full inference as about 60x slower and usually producing softer depth edges. |
| Movement exposes areas behind a foreground object | Use the documented surrounding-pixel fill | The hidden areas have no original pixel data. |
The permission interaction has two documented entry points. Tapping an image prompts automatically, while a custom interface can call getGyroPermission() and requestGyroPermission() from a click handler. The documentation says tilt input stays inactive until permission is granted. A developer choosing phone tilt therefore needs an intentional interaction for that permission rather than assuming the input becomes available as soon as the page loads.
Cache invalidation also belongs in the photograph's publishing workflow. The documentation keys stored maps by model, resolution and image URL. Replacing an image while retaining its URL therefore needs the documented URL change or refresh() call. Model caching and depth-map caching are separate options, and images with src-depth ignore the depth-map cache setting because they already have a map to load.
Fixed photographs can skip browser model loading
With src-depth, the element loads the photograph and a grayscale depth-map PNG without downloading the model, ONNX Runtime or WebAssembly, according to the precompilation documentation. Brighter pixels in the map represent closer parts of the image. For photographs already chosen for a site, generating that map during asset preparation moves depth estimation out of the visitor's browser.
The author documents a separate img-auto-parallax-build package with a Vite plugin, command-line tool and Node interface. Generated maps sit beside their source photographs, and unchanged files can be reused on later runs. Teams can treat maps as build output or commit them to avoid regenerating them in CI. These choices place the generated file alongside the image whose depth it represents.
Model-input resolution and saved-map dimensions are different settings. Input resolution controls the image sent through inference. The mapSize option controls whether the saved PNG contains the model's output dimensions or a full-size image for inspection and manual editing. The documentation describes browser upsampling along photograph edges for model-size maps. Selecting a larger saved PNG therefore changes the output representation without itself changing the inference input.
Live estimation serves photographs that arrive after the site is built, such as user uploads. The documentation describes model downloads, HTTP caching and optional browser storage for that path. It also renders the plain image first while depth loads. That initial image is a usable state in the component's documented sequence, followed by the depth effect when estimation and rendering are ready.
Outdated claims, corrected: the GPU wording changed
The older documentation capture says, "The result never leaves it," after describing depth estimation on the GPU. That sentence appears in the earlier depth-map explanation. The fresh official-page extract uses different wording. Keeping the two captures distinct makes this a correction to an older absolute statement rather than a claim that the current page repeats it.
The fresh official explanation says, "The depth texture stays on the GPU." The current depth-map explanation uses a narrower subject, the depth texture, and separately describes optional storage of estimated depth maps. Its cacheDepthMap option supports sessionStorage or IndexedDB so later visits can render from a stored map without loading the model. The texture statement and persistence description concern different representations and stages.
The documented persistence options give a more precise account than saying every representation stays exclusively in GPU memory. Session storage lasts until the tab closes; IndexedDB storage lasts until cleared, with recomputation when storage is unavailable. A product description can name the configured route directly: live browser estimation, optional local map persistence, or a map generated during the build and loaded through src-depth.
Early coverage describes features and dated star activity
HotRepo describes the component's capabilities and requirements. Its component overview covers pointer and phone-tilt movement, WebGPU depth estimation, the ordinary-image fallback and secure-context requirements. Separately, Trendshift reports 533 stars gained across November 30 to December 2, 2026. That dated figure describes repository star activity, a different quantity from installation results or browser rendering measurements.
The Next Site's Instagram caption describes hover and tilt movement, smoothing, idle sway and depth-of-field blur. That feature caption corresponds to controls described in the official playground. For an integration decision, the official documentation supplies the more specific requirements: a secure context, permission for iOS motion input, a static fallback, and a choice between live estimation and precompiled depth maps.
img-auto-parallax vs Parallax.js and Wappler Image Parallax
img-auto-parallax estimates depth within a photograph; the alternatives start with supplied layers, scrolling backgrounds or Wappler image attributes. The similar parallax names refer to different composition tasks. Choosing between them begins with the available artwork and the intended movement: separation inside one photograph, movement between prepared layers, or a background that moves as the visitor scrolls through content.
| Option | Documented starting point | Pick it when |
|---|---|---|
| img-auto-parallax | A photograph plus estimated or precompiled depth | You want foreground and background separation inside an existing photograph. |
| wagerfield/parallax | Scene children become moving layers driven by orientation or cursor position | You already have separate artwork layers and want control over their relative movement. |
| pixelcog/parallax.js | A jQuery plugin for parallax scrolling behind an element | An existing jQuery page needs a scrolling background. |
| Wappler Image Parallax | An image behavior added through Dynamic Attributes | You build in Wappler and want its direction, scale, delay and overflow controls. |
Wagerfield's Parallax.js makes direct scene children into moving layers by default. Its README assigns relative movement through each layer's data-depth attribute and describes orientation input with cursor input when motion hardware is unavailable. Prepared artwork therefore gives the developer explicit layer boundaries. img-auto-parallax instead starts with a flattened photograph and estimates the separation used for its effect.
Pixelcog's Parallax.js implements parallax scrolling as a jQuery plugin. Its README describes a fixed-position mirror behind the target element, including requirements for transparency and dimensions. Wappler's Image Parallax guide starts with a still image and applies the behavior through Dynamic Attributes. These documented starting points distinguish the alternatives by the material and page structure each one expects.
FAQ
img-auto-parallax needs no API key or model server for the browser models described in its installation documentation. Depth Anything V2 and FastDepth ship inside the package, and precompiled maps provide a separate route for fixed photographs. The README also gives registration, secure-context and licensing details. These first-time setup questions concern documented requirements rather than measured search demand.
How do you add img-auto-parallax to a page?
The README registers the component with the img-auto-parallax/define import, then uses an img-auto-parallax element with src and alt attributes. The official installation documentation also includes Vite configuration excluding img-auto-parallax and onnxruntime-web from optimizeDeps to keep model and WebAssembly assets resolvable. Registration, image markup and bundler configuration are separate parts of that documented browser integration path.
Does it need an API key or a model server?
No: the documentation says Depth Anything V2 and FastDepth ship inside the package and run locally in the browser, without a model server or API keys. The precompiled-map route instead supplies src-depth and skips browser model loading for that photograph. The documented rendering requirements still include WebGPU and a secure context, independently of where the map was generated.
What license does img-auto-parallax use?
The README lists MIT for the library and Apache-2.0 for the bundled model. Its license section points separately to the library license and models/NOTICE.md. A distribution review should therefore account for both the component and bundled model material. The project gives those two license statements separately, with the model notice linked from the same README section.
What we have not tested yet
Our recorded tasks cover repository checks and the failed version 0.2.1 Node/tsx import, without an interactive browser session or a demonstrated repair for that error. The release metadata lists v0.3.0 separately; neither recorded task is identified as a v0.3.0 release test. Actual runtime and operating-system versions require raw toolchain logs because lab-node:22 is an image label, not a runtime report.
Cold-start latency, frame rate, browser memory and battery use on named devices remain unmeasured here. We also have no difficult-image evaluation for hair, foliage or overlapping subjects, no browser-and-device compatibility matrix, and no recorded tests of permission rejection or reduced-motion behavior. The documented surrounding-pixel fill explains the approach without supplying an independent artifact-quality result. The development-installation sizes do not measure browser payload size.
Implementation behavior behind the GPU texture and optional persistence descriptions remains unverified. The text review includes no network audit, storage inspection or tracing of transfers between GPU memory and stored representations. It also includes no rendered-layout, asset, related-link, recommendation-module or template-behavior checks. The wording above describes the older capture and fresh documentation; it does not report an implementation inspection or a newly executed code example.
Independent production outcomes are absent from the coverage examined here. The available excerpts cover author demonstrations, a HotRepo overview, Trendshift activity and an Instagram caption rather than deployment measurements. Numerical judgments about support responsiveness, production maturity or browser setup would need additional observations. A practical next step is a browser integration using the intended photographs and target devices, with the static image accepted as the fallback.


