AI engineering
img2threejs: turn a reference image into editable Three.js
Learn how img2threejs builds procedural Three.js from a reference image, how to brief its staged workflow, and what to inspect before using the model on a website.

A reference image gives you a target. A useful web model also needs understandable parts, editable materials, sensible pivots, and a browser render that survives being rotated. img2threejs is a coding-agent skill that organizes the work between those two things: it reconstructs a subject through a specification, procedural Three.js code, and repeated visual review.img2threejs ↗
That makes it interesting for independent builders who want an interactive prop or a distinctive product illustration they can keep changing in code. The practical question is whether the reference supports the object you need, and whether the resulting model holds up in its intended use.
Understand what you get: a model built in code
The main output is a TypeScript factory returning a THREE.Group, accompanied by a JSON sculpt specification. Geometry, materials, and a part hierarchy describe the reconstructed subject. The project also exposes runtime information for nodes, sockets, colliders, and destruction groups through root.userData.sculptRuntime.img2threejs ↗img2threejs ↗
An editable hierarchy matters when the object needs to do something. For a hypothetical desk lamp, the shade should be a distinct part attached to a hinge, and the hinge should rotate around the right point. A convincing still image would not prove either property. Ask for the interaction you intend to ship while the structure is being designed.
The skill describes reconstruction through code rather than photogrammetry or direct mesh extraction. Its current workflow can also use reference-derived texture projection for surface matching, so procedural construction does not mean every surface must be represented by a flat color. Geometry, surface evidence, and export format are separate decisions.img2threejs ↗img2threejs ↗

Choose a reference that can answer the important questions
The input rubric favors one clear target, a readable silhouette, visible major materials, and enough information to infer the remaining structure. A crowded scene, cropped essential parts, or a request for manufacturing-grade dimensions can fail suitability before modeling starts. Additional front, side, back, and detail views can resolve specific uncertainties.img2threejs ↗
Start with the features that make your object recognizable. On our example lamp, these might be the shade angle, the base-to-height ratio, and the exposed hinge. Name them in the brief. A generic instruction to make a nice lamp leaves the agent free to produce a plausible substitute that misses your reference.
A single image leaves the back, depth, and hidden connections uncertain. The skill asks the agent to report approximations and request evidence where necessary. Decide how much inference your use permits: a fixed-view decorative illustration may tolerate assumptions that become obvious problems in a freely rotating product viewer.img2threejs ↗img2threejs ↗

Let structure pass review before polishing the surface
The workflow begins with image analysis, suitability, and a quality contract that defines the features and evidence needed for this subject. It then authors a sculpt specification. Strict validation checks whether that specification is sufficiently developed before the factory generator writes code.img2threejs ↗
| Stage | Question to resolve | Lamp example |
|---|---|---|
| Blockout and structure | Are the overall masses and part relationships right? | Base, stem, hinge, and shade have the right proportions and connections |
| Form refinement | Does the actual volume hold up beyond the reference angle? | The shade has depth and a meaningful opening rather than a flat cutout |
| Materials and surface | Do distinct surfaces read correctly? | Painted metal and the shade interior respond differently to light |
| Lighting and interaction | Does the model work in its intended scene? | The hinge pivots correctly and the object remains readable |
| Optimization | Does the retained detail fit the runtime budget? | The model remains responsive in the target mobile browser |
The table groups the project's ordered build passes into practical review questions; the lamp criteria are original examples. Upstream separates blockout, structure, form, material, surface, lighting, interaction, and optimization. Each pass needs its own acceptance evidence before the next unlocks.img2threejs ↗
This order helps you give actionable feedback. If the shade is too shallow, correcting the shape addresses the problem. Adding shinier paint changes a different variable. Review large proportions early, while the model is still simple enough to diagnose.
Install for the agent you use, then restart it
The reviewed installation guide requires Node.js 18 or newer, Git, Python 3.10 or newer, and a supported coding agent. It documents macOS and Linux support; Windows is not supported by that CLI revision. The installer normally links a shared checkout into every supported agent directory it detects, with --host available to select one and --dry-run to inspect the planned changes.img2threejs ↗
npx --yes img2threejs@latest install --host codex --dry-run
npx --yes img2threejs@latest install --host codex
npx --yes img2threejs@latest doctorThese are instructions for a reader who chooses to install the skill; they were not executed for this article. Restart the agent after installation. The @latest commands resolve the release available when you run them, which may differ from the source revision reviewed here. Consult the official install guide for your host, including its additional Hermes profile setup.img2threejs ↗
The generic and character profiles are built into the core. Specialized domain profiles and the animated-character workflow can require separate plugins. A generic lamp does not require installing every plugin. Check the profile needed for the requested behavior before assuming that an installed core skill includes the whole animation pipeline.img2threejs ↗img2threejs ↗
Brief one small model with a concrete use
Use an isolated example project and a reference you can inspect easily. Decide whether the viewer can rotate the object, which parts need interaction, and what performance target is meaningful on your intended devices. A triangle count alone cannot demonstrate a smooth user experience; retain browser measurements with the model.
Use the img2threejs skill to assess ./reference.png for an interactive browser prop. The subject is [OBJECT]. Its defining features are [FEATURES]. The viewer will [ROTATE / USE A FIXED VIEW], and these parts need interaction: [PARTS AND MOTION].
First inspect the reference, identify the suitable profile, list visible evidence and inferred regions, and propose a subject-specific quality contract. Ask for additional views when missing geometry would affect the intended use. Report any unavailable profile or tooling. Stop after this assessment so I can review the scope.
For the subsequent approved build, use the documented local state and staged gates. Preserve the sculpt specification, editable TypeScript factory, renders, comparison sheets, and review history. Review the silhouette and structure before materials. Confirm the interaction from multiple angles and measure runtime behavior on [TARGET DEVICE / BROWSER]. State approximations plainly. Do not install optional plugins or add unrelated site features as part of the model build.The assessment checkpoint is a suggested first-run arrangement, not a mandatory extra step imposed by this article on every project. It lets you catch a mismatch between the reference, the expected fidelity, and the amount of reconstruction work before spending time on fine detail.
Read the evidence behind a passing review
The project combines deterministic checks with agent visual judgment. Its self-correction contract distinguishes a wrong specification from an implementation that fails to realize a sound specification. A review can continue, refine the spec, refine the code, request input, or stop. A correction should leave evidence explaining the mismatch and the change.img2threejs ↗
Look at more than the overall visual score. The gate reference includes turntable, attachment, intersection, and critical-feature checks because a single good angle can conceal missing depth or a floating component. Read what each check actually sampled and what remains unmeasured; a clean report covers its inputs, not every possible defect.img2threejs ↗
- Compare the original reference and the final browser render at a matched viewpoint. Then rotate to inspect depth, rear surfaces, openings, and joins.
- Try each promised interaction. Confirm that parts move around the intended pivot and remain attached throughout the motion.
- Read the sculpt specification and the retained TypeScript together. Make a small parameter edit to see whether the model is understandable and reproducible.
- Keep the reference, inferred-region notes, screenshots, and review history with the candidate. Explain the remaining mismatches in ordinary language.
- Measure the scene in the actual destination page. Check loading, responsiveness, memory behavior, and disposal when the component unmounts.
This checklist is an integration review proposed for builders. It does not assert that the skill automatically tests your entire application. In particular, a readable factory and successful reconstruction review leave page accessibility, surrounding interactions, and device-specific performance to the application work.
When the result misses, correct the right layer
Describe the mismatch precisely: the base is too narrow relative to the stem, the shade has no interior, or the hinge rotates around the model origin. Those observations point to a proportion, geometry, or hierarchy problem. A request to make it more realistic gives the next iteration much less information.
The upstream review guidance also warns that framing, background, and lighting differences can distort photo-to-render pixel comparisons. Match the review setup and inspect the feature that matters instead of reshaping a sound object to chase an aggregate score. When hidden structure is the blocker, another reference can be more useful than another correction cycle.img2threejs ↗
Start with one object whose identity you can describe and whose behavior you can test. Keep the spec, factory, and evidence together. That gives you an editable asset and a way to understand its limitations when the next design change arrives.
Sources & further reading
Checked November 7, 2026. Definitions and guidance come from the references below; prompts and concepts are original sinabuilds work.
- img2threejs project overview and output contract img2threejs
Primary overview, procedural TypeScript output, intended uses, and stated limitations. Reviewed at version 2.0.1; author claims are not treated as an independent benchmark.
- The img2threejs skill router img2threejs
Primary workflow order, local-state authority, profile boundaries, inference disclosures, and reference-derived surface path.
- Object image validation rubric img2threejs
Suitability criteria, unsupported fidelity demands, and guidance for requesting additional views.
- Pre-spec assessment and quality contract img2threejs
Subject-specific definition of done and strict specification validation before code generation.
- Pipeline architecture and output artifacts img2threejs
Ordered passes, review artifacts, hierarchy, and the division between scripted checks and visual judgment.
- Reference-derived texture workflow img2threejs
Texture and projection guidance. Procedural geometry is not represented here as a ban on reference-derived surface maps.
- Official installation guide img2threejs
Prerequisites, supported hosts, scoped installation, dry run, doctor, restart, and Hermes-specific setup. Installation commands were researched, not executed.
- Plugin and profile integration img2threejs
Distinguishes built-in profiles from separately installed domain and animation extensions.
- Self-correction and interpretation of fidelity evidence img2threejs
Review actions, mismatch diagnosis, photo-to-render comparison caveats, and evidence requirements.
- Gate-by-gate review reference img2threejs
Multi-angle and geometric checks, evidence boundaries, and critical-feature acceptance.