This is a simple python script that converts an image to the bezier curves which can be plotted on desmos.
- Python >= 3.9
- [Optional] Chafa (for previewing images in terminal)
pip install img2desmos
> img2desmos --help
Usage: img2desmos [OPTIONS] IMG
╭─ Arguments ───────────────────────────────────────────────────────────────────────────────╮
│ * img TEXT Path to the image to convert into graph [default: None] [required] │
╰───────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Options ─────────────────────────────────────────────────────────────────────────────────╮
│ --output -o TEXT Output formulas file path [default: None] │
│ --preview -p Preview the img in a window (chafa is required) │
│ --upper INTEGER Upper threshold for the edge detection [default: 200] │
│ --lower INTEGER Lower threshold for the edge detection [default: 100] │
│ --help Show this message and exit. │
╰───────────────────────────────────────────────────────────────────────────────────────────╯
Formulas will be pasted into clipboard