Skip to content

Charles Borg - an agent for creating atelier-style drawing tutorials.

Notifications You must be signed in to change notification settings

fletchgraham/charles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Charles

AI agent that generates Bargue-style atelier drawing tutorials from reference photos.

Current State (Phase 1 POC)

Working pipeline: segmentation → envelope extraction → charcoal stroke rendering

cd /Users/fletchgraham/dev/charles
source venv/bin/activate
cd src
python main.py ../input/main-image.jpg -p 20

What Works

  • rembg isolates subject from background
  • Binary search finds correct Douglas-Peucker epsilon for target point count
  • Basic charcoal renderer with bristle simulation, paper texture, plumb lines

What Needs Work

  • Strokes too thin/timid - need bolder marks
  • No stroke weight variation (corners vs straight runs)
  • Construction marks barely visible

Next Steps (in order of Bargue method)

  1. Shadow shape mapping - separate light/dark, draw shadow shapes
  2. Shadow lay-in - fill shadows with even tone (hatching)
  3. Depth analysis - use Depth Anything V2 to separate masses into sub-envelopes
  4. VLM reasoning - Claude vision for artistic decisions + written explanations

Project Structure

src/
  main.py          # CLI entry point
  segmentation.py  # rembg wrapper
  envelope.py      # contour extraction + Douglas-Peucker simplification
  renderer.py      # CharcoalRenderer class with stroke primitives
input/             # reference images
output/            # generated drawings

Key Files to Read

  • VISION.md - full product vision, Bargue method explanation
  • TECHNICAL_PLAN.md - comprehensive tech research (SAM3, Depth Anything, p5.brush, Tripo API, etc.)

Tech Decisions Made

  • Segmentation: rembg (simple, works) - can upgrade to SAM later
  • Envelope: OpenCV contours + Douglas-Peucker
  • Rendering: PIL-based charcoal simulation (will likely move to p5.brush for web)
  • Future 3D: Headless Blender + Tripo API

Commands

# Basic usage
python main.py image.jpg

# Control envelope detail
python main.py image.jpg -p 12   # simpler (fewer points)
python main.py image.jpg -p 30   # more detailed

# Options
--no-plumb         # skip plumb line
--no-construction  # skip vertex marks
-o path.png        # custom output path

About

Charles Borg - an agent for creating atelier-style drawing tutorials.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages