---
estimated_steps: 8
estimated_files: 3
skills_used: []
---

# T03: Potrace vectorization (Mode A)

1. Create engine/pipeline/vectorize.py
2. Implement potrace_trace() function:
   - Accepts preprocessed numpy array (binary image)
   - Calls pypotrace with tunable params: turdsize, alphamax, opticurve, opttolerance
   - Returns SVG string
3. Handle potrace bitmap creation from numpy array
4. Test with a clean high-contrast test image
5. Verify SVG output is well-formed

## Inputs

- `engine/pipeline/preprocessing.py`

## Expected Output

- `engine/pipeline/vectorize.py`
- `engine/tests/test_vectorize.py`

## Verification

cd engine && python -m pytest tests/test_vectorize.py -v -k potrace
