kayforkind/skill-slice/3d-image-to-model

Claude Code and agent skill by kayforkind/skill-slice

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Converts a 2D image, photo set, or SVG into a 3D mesh or printable STL (depth maps, photogrammetry, extrusion, lithophanes). Use when the user wants image-to-3D, photo-to-mesh, heightmap STL, or lithophane. Not for game engine meshes or Godot/Blender scene lighting. Never assume this folder ships helper scripts.

Install

npx vskill@latest install kayforkind/skill-slice/3d-image-to-model

SKILL.md

The same SKILL.md was published earlier as kayforkind/skill-slice/3d-image-to-model.

When to Use

Use this skill when the user wants to convert 2D images into 3D models or printable STL files. Trigger keywords: "image to 3D", "photo to 3D", "depth map to mesh", "lithophane", "SVG extrusion", "photogrammetry", "Meshroom", "COLMAP", "MiDaS", "Depth Anything", "Meshy", "Tripo3D", "InstantMesh", "heightmap to STL", "relief model".

Approach Selection Matrix
MethodInputSpeedQualityBest For
AI Image-to-3D1 imageSeconds–minutesApproximateConcept art, game assets, prototyping
Depth Estimation1 imageSecondsRelief / 2.5DBas-reliefs, heightmaps, lithophanes
Photogrammetry30–200+ imagesHoursHigh fidelityReal-world objects, archival
SVG ExtrusionVector artInstantExactLogos, text, flat designs
Lithophane1 photoMinutesPhoto-qualityBacklit photo displays

Prerequisites

Python Environment (Windows / PowerShell)
powershell
# Create and activate a virtual environment
python -m venv .venv
.\.venv\Scripts\Activate.ps1
# Core dependencies
pip install torch torchvision torchaudio
pip install open3d numpy-stl pillow opencv-python numpy
pip install transformers
pip install svgpathtools shapely triangle
pip install pymeshfix pyvista
GPU Requirements by Method
MethodVRAM MinimumNotes
MiDaS DPT_Large2 GBRuns on CPU if no GPU
Depth Anything V2 Large4 GBCPU fallback supported
Depth Anything V2 Small1 GBReal-time, low-resource
Marigold8 GBDiffusion-based, slow
InstantMesh8 GBNVIDIA GPU required
External Tools
  • Meshroom: Download from AliceVision releases; NVIDIA GPU required for full pipeline.
  • COLMAP: Install from https://colmap.github.io/; available as CLI or GUI.
  • OpenSCAD: Install for SVG extrusion method (https://openscad.org/).
  • MeshLab: Install for mesh cleanup; CLI via meshlabserver.
  • Blender: Optional for advanced mesh editing and retopology.
API Keys (if using commercial AI tools)
  • Meshy AI: Register at meshy.ai to obtain an API key. Store as environment variable:

``powershell $env:MESHY_API_KEY = "YOUR_KEY" ``

  • Tripo3D: Browser-based at tripo3d.ai; no API key needed for basic use.

Procedure

Step 0 — Determine Input Type and Select Approach
  1. Single image, 3D object → AI tools (Meshy, Tripo3D) or InstantMesh (Step 1).
  2. Single image, relief / heightmap → Depth estimation + heightmap_to_stl (Step 2 → Step 3).
  3. Multiple photos, real object → Photogrammetry (Meshroom or COLMAP) (Step 4).
  4. Vector art / logo → SVG extrusion (Step 5).
  5. Photo display (backlit) → Lithophane: heightmap_to_stl with invert=True (Step 3).

Step 1 — AI Image-to-3D Tools
Meshy AI
  • URL: meshy.ai
  • Capabilities: Text-to-3D, Image-to-3D, AI texturing, retopology
  • Output formats: GLB, FBX, OBJ, STL
  • Workflow:
  1. Upload a reference image (clear, well-lit, single object).
  2. Select style preset (realistic, cartoon, low-poly).
  3. Generate initial mesh (30–60 seconds).
  4. Refine with AI texturing or manual edits.
  5. Export as STL for 3D printing.
Tripo3D (Tripo AI)
  • URL: tripo3d.ai
  • Capabilities: Image-to-3D, text-to-3D, integrated editing/rigging
  • Output formats: GLB, OBJ, FBX
  • Workflow:
  1. Upload image or enter text prompt.
  2. AI generates mesh in 10–30 seconds.
  3. Use built-in editing tools (segmentation, cleanup).
  4. Export mesh for printing.
InstantMesh (Open-Source, Local)
  • Repo: github.com/TencentARC/InstantMesh
  • Architecture: Multi-view diffusion (Zero123++) + Large Reconstruction Model (LRM)
  • Requirements: NVIDIA GPU with 8+ GB VRAM
powershell
git clone https://github.com/TencentARC/InstantMesh
cd InstantMesh
pip install -r requirements.txt
python run.py --input image.png --output output_mesh.obj
Other Notable AI Tools
ToolTypeHighlights
Wonder3DOpen-sourceMulti-view generation + reconstruction
Shap-E (OpenAI)Open-sourceText/image to 3D; lightweight
Rodin AICommercialHigh-fidelity textures
Stable Zero123Open-sourceSingle-view 3D diffusion
LGMOpen-sourceLarge Gaussian Model; fast inference

Step 2 — Depth Estimation
MiDaS (Intel Labs)
  • Architecture: DPT (Dense Prediction Transformer)
  • Output: Relative depth map (grayscale image)
  • Models: midas_v21_small, dpt_large, dpt_swin2_large
  • Strengths: Robust, well-tested, runs on CPU
python
"""
MiDaS Depth Estimation — generates a depth map from a single image.
Write a local helper named midas_depth.py
"""
import torch
import cv2
import numpy as np
def estimate_depth_midas(
image_path: str,
model_type: str = "DPT_Large",
output_path: str = "depth_map.png",
) -> np.ndarray:
"""
Run MiDaS depth estimation on a single image.
Args:
image_path: Path to input image.
model_type: MiDaS model variant ('DPT_Large', 'DPT_Hybrid', 'midas_v21_small').
output_path: Where to save the depth map.
Returns:
Depth map as a numpy array (H, W), normalized 0-255.
"""
model = torch.hub.load("intel-isl/MiDaS", model_type)
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model.to(device).eval()
midas_transforms = torch.hub.load("intel-isl/MiDaS", "transforms")
if model_type in ["DPT_Large", "DPT_Hybrid"]:
transform = midas_transforms.dpt_transform
else:
transform = midas_transforms.small_transform
img = cv2.imread(image_path)
img_rgb = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
input_batch = transform(img_rgb).to(device)
with torch.no_grad():
prediction = model(input_batch)
prediction = torch.nn.functional.interpolate(
prediction.unsqueeze(1),
size=img_rgb.shape[:2],
mode="bicubic",
align_corners=False,
).squeeze()
depth = prediction.cpu().numpy()
depth_normalized = (depth - depth.min()) / (depth.max() - depth.min()) * 255
depth_uint8 = depth_normalized.astype(np.uint8)
cv2.imwrite(output_path, depth_uint8)
print(f"Depth map saved to {output_path}")
return depth_uint8
if __name__ == "__main__":
depth = estimate_depth_midas("my_photo.jpg", output_path="depth_output.png")
Depth Anything V2 (TikTok / ByteDance)
  • Architecture: DINOv2 backbone + DPT decoder
  • Models: vits (25M params), vitb (97M), vitl (335M)
  • Strengths: State-of-the-art quality, fast, multiple model sizes
python
"""
Depth Anything V2 depth estimation.
Write a local helper named depth_anything_v2.py
"""
import torch
from transformers import pipeline
from PIL import Image
import numpy as np
def estimate_depth_anything_v2(
image_path: str,
output_path: str = "depth_dav2.png",
) -> np.ndarray:
"""Run Depth Anything V2 on a single image."""
pipe = pipeline(
task="depth-estimation",
model="depth-anything/Depth-Anything-V2-Large-hf",
device=0 if torch.cuda.is_available() else -1,
)
image = Image.open(image_path)
result = pipe(image)
depth_map = np.array(result["depth"])
depth_norm = ((depth_map - depth_map.min()) /
(depth_map.max() - depth_map.min()) * 255).astype(np.uint8)
Image.fromarray(depth_norm).save(output_path)
print(f"Depth Anything V2 map saved to {output_path}")
return depth_norm
Marigold (ETH Zurich)
  • Architecture: Diffusion-based depth estimation
  • Strengths: Fine detail, sharp edges, handles complex scenes
  • Trade-off: Slower than feed-forward models (diffusion denoising steps)
  • VRAM: 8 GB minimum
Model Comparison
ModelSpeedQualityVRAMBest For
MiDaS DPT_LargeFastGood2 GBCPU-friendly general use
Depth Anything V2 LargeFastExcellent4 GBBest overall quality/speed
Depth Anything V2 SmallVery FastGood1 GBReal-time, low-resource
MarigoldSlowExcellent8 GBMaximum detail, research

Step 3 — Depth Map to 3D Mesh Conversion
Option A: numpy-stl Heightmap (Simpler, Recommended for Relief/Lithophane)
python
"""
Simple heightmap to STL converter using numpy-stl.
Write a local helper named heightmap_to_stl.py
Faster and simpler than Open3D for basic relief/lithophane models.
"""
import numpy as np
from stl import mesh
from PIL import Image
def heightmap_to_stl(
image_path: str,
output_path: str = "heightmap.stl",
width_mm: float = 100.0,
max_height_mm: float = 5.0,
base_mm: float = 1.0,
invert: bool = False,
) -> None:
"""
Convert a grayscale image to a heightmap STL.
Args:
image_path: Grayscale image path.
output_path: Output STL path.
width_mm: Physical width.
max_height_mm: Maximum relief height above base.
base_mm: Base thickness.
invert: If True, darker = taller (lithophane mode).
"""
img = np.array(Image.open(image_path).convert("L"), dtype=np.float64)
if invert:
img = 255.0 - img
h, w = img.shape
pixel_size = width_mm / w
# Normalize to [0, max_height_mm]
heights = (img / 255.0) * max_height_mm + base_mm
faces = []
for y in range(h - 1):
for x in range(w - 1):
# Top surface: two triangles per quad
v00 = [x * pixel_size, y * pixel_size, heights[y, x]]
v10 = [(x + 1) * pixel_size, y * pixel_size, heights[y, x + 1]]
v01 = [x * pixel_size, (y + 1) * pixel_size, heights[y + 1, x]]
v11 = [(x + 1) * pixel_size, (y + 1) * pixel_size, heights[y + 1, x + 1]]
faces.append([v00, v10, v11])
faces.append([v00, v11, v01])
# Bottom surface (flat at z=0)
b00 = [x * pixel_size, y * pixel_size, 0]
b10 = [(x + 1) * pixel_size, y * pixel_size, 0]
b01 = [x * pixel_size, (y + 1) * pixel_size, 0]
b11 = [(x + 1) * pixel_size, (y + 1) * pixel_size, 0]
faces.append([b00, b11, b10])
faces.append([b00, b01, b11])
# Side walls
for x in range(w - 1):
# Front wall (y=0)
faces.append([[x * pixel_size, 0, 0],
[(x + 1) * pixel_size, 0, heights[0, x + 1]],
[x * pixel_size, 0, heights[0, x]]])
faces.append([[x * pixel_size, 0, 0],
[(x + 1) * pixel_size, 0, 0],
[(x + 1) * pixel_size, 0, heights[0, x + 1]]])
# Back wall
y_max = (h - 1) * pixel_size
faces.append([[x * pixel_size, y_max, 0],
[x * pixel_size, y_max, heights[h - 1, x]],
[(x + 1) * pixel_size, y_max, heights[h - 1, x + 1]]])
faces.append([[x * pixel_size, y_max, 0],
[(x + 1) * pixel_size, y_max, heights[h - 1, x + 1]],
[(x + 1) * pixel_size, y_max, 0]])

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
5

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/kayforkind/skill-slice/3d-image-to-model/badge)](https://verified-skill.com/skills/kayforkind/skill-slice/3d-image-to-model)

Something wrong with this skill or its page? Tell us.