Artificial intelligence tools capable of transforming an image into a 3D object have been improving for some time, but most share the same philosophy: directly generating a mesh, often complex, heavy, and difficult to modify. img2threejs takes a different approach: reconstructing the object by writing procedural code with Three.js.
The project is open source, distributed under the Apache 2.0 license, and designed to work with agents such as Claude Code, Codex, and OpenCode. From a reference image, it generates a TypeScript factory that returns a THREE.Group composed of primitives, generated geometry, materials, and a hierarchy prepared for animation and interaction.
The key points in 30 seconds
- img2threejs reconstructs objects from a reference image.
- It does not base the result on photogrammetry or the automatic extraction of a large mesh.
- It generates TypeScript and Three.js code.
- It uses primitives, procedural shaders, and generated geometry.
- It can incorporate pivots, sockets, colliders, and component hierarchies.
- It works in multiple stages and compares resulting renders against the reference.
- It is designed to run with Claude Code, Codex, and OpenCode.
- The result can be edited, version-controlled, and reused like any other code.
- The project explicitly acknowledges the limitations involved in reconstructing three-dimensional geometry from a single image.
From an image to Three.js code
The fundamental difference with img2threejs lies in the output it produces.
Instead of simply returning a 3D file, the system builds a TypeScript function responsible for recreating the object using Three.js. The repository itself describes this as a “reconstruction-by-code” process, explicitly distinguishing it from photogrammetry, mesh extraction, or the use of pre-built asset packs.
This means an object can ultimately consist of elements that developers can understand: geometric primitives, curves, materials, procedural geometry, and hierarchically organized components.
According to the project’s current documentation, the result is a factory that returns a THREE.Group. In addition to visible geometry, there can be a runtime structure with pivots, sockets, colliders, and other elements designed so the model can later be animated or integrated into an application.
It does not try to solve everything in a single generation
Another interesting aspect is that img2threejs does not approach reconstruction as a single AI prompt.
Instead, it uses a progressive pipeline similar to a digital sculpting process.
The currently documented stages are:
blockout → structural → form → material → surface → lighting → interaction → optimization
The process starts with the overall volumes and structure. Shapes, materials, and surfaces are then refined before moving on to lighting, interaction, and optimization.
The system generates and reviews each stage using vision, comparing the original reference image with the resulting render. The goal is to identify differences and correct the model before moving on to the next stage.
The AI judges; scripts handle the mechanical work
One of the more interesting aspects of the architecture is the way it attempts to reduce token consumption.
The project avoids asking the language model to perform all the mechanical tasks involved in the process.
A collection of deterministic Python scripts handles areas such as validation, pipeline state management, specification generation, quality checks, and the creation of comparison sheets.
The AI is primarily reserved for the task where it is most useful: looking at the result and deciding what needs to be corrected.
According to the project, its core scripts work with Python 3.10 or later and are designed without external dependencies for the basic workflow.
Before building, it tries to understand the object
img2threejs also includes a phase called detailInventory.
Before code generation begins, the system attempts to identify small features that are important for preserving the object’s visual identity.
These can include:
- bevels and rounded edges;
- screws and rivets;
- engraved or painted lines;
- contours;
- differences between matte and glossy surfaces;
- wear and stains;
- small structural details.
These elements must then be associated with a specific component or material.
There is even a strict quality mode that can block generation when the initial specification is considered too shallow.
A model designed to remain editable
This is probably the main conceptual advantage over many image-to-3D systems.
An automatically generated mesh may look convincing, but modifying it afterwards is not always straightforward.
With img2threejs, the object is code.
A developer can therefore locate a component, change its dimensions, replace a material, alter its position, or even completely replace the logic used to construct it.
Behavior can also be added.
For example, a door can have a rotation pivot, a wheel can become an independent component, or specific parts can be exposed as sockets for attaching other objects later.
This approach can be particularly useful for:
- 3D web experiences;
- product configurators;
- video games;
- interactive visualizations;
- prototypes;
- WebGL interfaces;
- generative scenes;
- educational experiences;
- applications that need to manipulate objects in real time.
Models can run directly in the browser
The repository includes a separate gallery where reconstructions run directly using Three.js.
Available examples include a BMX bike, Sony WF-1000XM3 earbuds with their charging case, a Doraemon house diorama, and various hard-surface objects.
The project explicitly states that the demos are built using primitives, procedural shaders, and generated geometry, and that the source code for each reconstruction can be inspected.
This reinforces one of img2threejs’ central ideas: the goal is not to obtain an opaque 3D file, but rather a model that can become a direct part of an application’s codebase.
It also supports characters, although with significant limitations
The project has expanded its original approach beyond rigid objects.
It currently classifies subjects as object, character, or hybrid.
Characters follow a dedicated path that takes proportions, facial landmarks, and pose into account. There is also an optional mode aimed at maximizing likeness through parametric template fitting, camera matching, and projection of the reference image.
However, the project itself includes an important warning here.
A single image cannot accurately reveal every part of a three-dimensional object.
Hidden surfaces must be inferred, and the system cannot guarantee geometrically exact reconstruction.
In fact, the documentation states that lower-confidence regions should be identified and that additional reference images may be required when high fidelity is important.
It can also use multiple views
To reduce this limitation, there is an optional mode called visualHull.
When at least two orthographic silhouettes are provided, the system can intersect them to build a volumetric approximation.
Instead of automatically inventing what is not visible in the images, the system records unknown regions as low-confidence areas.
This is an important distinction because it separates probable reconstruction from geometry that is actually supported by the reference material.
How to use img2threejs
The documented installation for Claude Code involves cloning the repository into the skills directory:
git clone https://github.com/img2threejs/img2threejs.git ~/.claude/skills/img2threejsCode language: PHP (php)
A reference image can then be attached and a request similar to the following can be used:
/img2threejs Rebuild this object as a Three.js model,
keep the proportions, angles, and colours.Code language: JavaScript (javascript)
The system analyzes the image, creates an initial assessment, generates a specification, and then progressively builds the model through its different stages.
It can also be used with Codex or OpenCode, as the project is designed to remain independent of the specific agent providing vision and browser access.
It does not necessarily replace traditional image-to-3D tools
img2threejs should not simply be understood as a direct competitor to every traditional 3D model generator.
Its objective is different.
When the only priority is to quickly obtain a highly detailed mesh for rendering, other techniques may be more appropriate.
img2threejs becomes particularly interesting when the final structure needs to be:
- understandable;
- editable;
- procedural;
- animation-ready;
- lightweight;
- versionable with Git;
- directly integrable into a web application.
Its main output includes both an ObjectSculptSpec JSON specification and a TypeScript factory that generates the object.
This also means changes can be reviewed through diffs and maintained in a software repository just like any other part of an application.
Its roadmap goes far beyond individual objects
The project’s roadmap points toward something considerably more ambitious.
Future stages include improvements to character reconstruction, environment generation, Unity and Unreal exporters, Blender integration, LOD generation, auto-rigging, and a future web interface.
Further ahead, the roadmap also includes multi-view reconstruction and procedural generation of complete environments.
It is important, however, to distinguish these plans from currently available features: several are explicitly part of the roadmap and should not be interpreted as completed functionality.
A different way of thinking about AI-generated 3D
The most interesting idea behind img2threejs may not simply be that AI can reconstruct an object from a photograph.
Other systems can already do that.
What is different is the idea that the final 3D asset can be code rather than a file.
An object therefore stops being merely a mesh imported into an application and becomes a programmable structure whose components, materials, interactions, and animations can be modified directly.
For web development and interactive experiences, that distinction could prove important.
Traditional image-to-3D tools try to generate geometry.
img2threejs tries to generate something different: the recipe for reconstructing that geometry through code.
And that is precisely why it could become particularly interesting for developers who want to use artificial intelligence not only to create 3D assets, but to obtain assets they can subsequently understand, modify, and program.
Source
Official img2threejs repository on GitHub.
