- Depth-aware auto placement with wall candidate detection
- Adjacent wall targeting (
left,center,right, or best-fitauto) - Manual four-point override when needed
- Backend OpenCV rendering plus client-side OpenCV.js fallback
SpatialCanvas is an open-source engine for turning a single image into a spatially-aware staging canvas.
The project starts with one sharp promise:
Upload a room photo, mark a wall plane, and place artwork with correct perspective, scale cues, and depth-aware shadows.
Instead of leading with abstract math, SpatialCanvas leads with a tactile artifact that developers can improve. Under the hood it is designed for contributions in geometry, robotics math, signal processing, computer vision, rendering, and human-computer interaction.
Most virtual staging tools place flat overlays on top of images. SpatialCanvas aims to push beyond that by combining:
- projective geometry and homographies
- camera and plane reasoning
- optional depth estimation and segmentation
- physically-plausible shadows and occlusion
- an extensible plugin system for new math and rendering experiments
The included MVP is intentionally practical:
- Upload a room image
- Click four points on a wall in clockwise order
- Upload artwork
- The engine warps the artwork into the selected plane using a perspective transform
- A soft contact shadow is rendered to make placement feel more grounded
- The transformed result can be downloaded
This gives the community a concrete baseline to improve.
spatialcanvas/
app/ FastAPI server + API routes
frontend/ Lightweight browser client
spatialcanvas/ Core Python package
geometry/ Projective geometry + homography math
rendering/ Placement rendering and shadows
plugins/ Extension hooks and sample plugins
vision/ Stubs/interfaces for depth/layout modules
tests/ Unit tests for core math and rendering
.github/ Community health and workflow files
python -m venv .venv
source .venv/bin/activatepip install -r requirements.txtuvicorn app.main:app --reloadThen open:
http://127.0.0.1:8000
Form fields:
scene_image: room photoart_image: artwork imagewall_points_json: JSON array of four[x, y]points in clockwise ordershadow_strength: optional float from0.0to1.0margin_ratio: optional float to leave a clean border inside the plane
Returns:
- PNG bytes of the composited result
- Useful first: the first experience should work in minutes.
- Math-friendly: the architecture should reward contributions from geometry and robotics communities.
- Progressive intelligence: depth maps and learned models plug in later without forcing them into the core.
- Open by design: examples, tests, and docs are first-class.
- Manual wall plane selection
- Perspective-correct artwork placement
- Contact shadow rendering
- Downloadable output
- Plugin interface for placement refinement
- Auto wall candidate detection from line structure
- Vanishing point estimation utilities
- Occlusion mask input/output support
- Furniture/cardboard-box 2.5D placement primitives
- Monocular depth adapter
- Layout confidence map
- Multi-object scene graph
- WebGL viewer
- Full community benchmark
- Standard plugin registry
- Public demo gallery
- Reference integrations with Three.js and Blender
Please start with:
CONTRIBUTING.mdCODE_OF_CONDUCT.md- open issues labeled
good first issue,geometry,vision, orrendering
MIT
For launch-ready assets, starter issues, discussion thread drafts, social copy, and helper scripts, see launch/.