|
1 | | -# Chart2CSV - Plot Digitizer |
| 1 | +# Chart2CSV — Zero-Click AI Chart Extraction |
2 | 2 |
|
3 | | -Extract data from chart images (PNG/JPG/PDF) to CSV/JSON with Computer Vision and OCR. |
| 3 | +> **The killer feature:** Unlike traditional digitizers that require manual point clicking, Chart2CSV uses AI vision to instantly extract all data points. Drop your chart, get CSV. |
4 | 4 |
|
5 | | -## Problem |
| 5 | +[](https://kiku-jw.github.io/Chart2CSV/) |
| 6 | +[](LICENSE) |
| 7 | +[](https://python.org) |
6 | 8 |
|
7 | | -Scientific papers, reports, and presentations often contain charts without source data. Researchers, analysts, and data scientists need to extract numbers from chart images quickly and reproducibly. |
| 9 | +## 🎯 Why Chart2CSV? |
8 | 10 |
|
9 | | -## Solution |
| 11 | +| Feature | WebPlotDigitizer | PlotDigitizer Pro | **Chart2CSV** | |
| 12 | +|---------|------------------|-------------------|---------------| |
| 13 | +| Extraction | Manual clicking | Semi-auto | **⚡ Zero-click AI** | |
| 14 | +| Speed | Slow (click each point) | Moderate | **Instant** | |
| 15 | +| Price | Free | $$$ Subscription | **Free & Open Source** | |
| 16 | +| Multiple curves | No | One at a time | **Detects automatically** | |
| 17 | +| API Access | ❌ | ❌ | **✅ CLI + Python** | |
| 18 | +| AI OCR | ❌ | ❌ | **✅ Mistral Vision** | |
| 19 | +| Privacy | Cloud upload | Cloud upload | **🔒 Runs locally** | |
10 | 20 |
|
11 | | -**Chart2CSV** is an offline-first CLI tool that: |
12 | | -- Takes PNG/JPG chart images (or PDF pages) |
13 | | -- Returns CSV data + JSON metadata + confidence scores + visual overlay |
14 | | -- Provides honest confidence reporting and manual calibration fallback |
15 | | -- Works completely offline (privacy by default) |
16 | | - |
17 | | -## Quick Start |
| 21 | +## ⚡ Quick Start |
18 | 22 |
|
19 | 23 | ```bash |
20 | 24 | # Install |
21 | 25 | pip install chart2csv |
22 | 26 |
|
23 | | -# Basic usage |
24 | | -python -m chart2csv.cli.main plot.png --output data.csv |
| 27 | +# Basic — just drop and extract |
| 28 | +python -m chart2csv.cli.main plot.png |
25 | 29 |
|
26 | | -# With overlay for verification |
27 | | -python -m chart2csv.cli.main plot.png --overlay check.png |
| 30 | +# With AI (Mistral Vision) — better OCR |
| 31 | +export MISTRAL_API_KEY=your_key |
| 32 | +python -m chart2csv.cli.main plot.png --use-mistral |
28 | 33 |
|
29 | | -# Batch processing |
| 34 | +# Batch — process entire folder |
30 | 35 | python -m chart2csv.cli.main figures/ --batch --output-dir results/ |
31 | 36 |
|
32 | | -# Manual calibration (when auto fails) |
33 | | -python -m chart2csv.cli.main plot.png --calibrate |
| 37 | +# Verify with overlay |
| 38 | +python -m chart2csv.cli.main plot.png --overlay check.png |
34 | 39 | ``` |
35 | 40 |
|
36 | | -## Supported Chart Types (MVP) |
| 41 | +## 🌐 Try It Now |
| 42 | + |
| 43 | +**[Live Demo →](https://kiku-jw.github.io/Chart2CSV/)** |
| 44 | + |
| 45 | +No installation required. Uses Mistral Vision API directly in your browser. |
| 46 | + |
| 47 | +## 🚀 Key Features |
| 48 | + |
| 49 | +### Zero-Click AI Extraction |
| 50 | +- **No manual point clicking** — AI understands your chart |
| 51 | +- **Automatic axis detection** — finds X/Y axes and scale |
| 52 | +- **Smart OCR** — reads tick labels accurately |
| 53 | +- **Multiple backends** — Tesseract (offline) or Mistral (cloud) |
| 54 | + |
| 55 | +### Developer-First |
| 56 | +```bash |
| 57 | +# CLI with all options |
| 58 | +python -m chart2csv.cli.main chart.png \ |
| 59 | + --use-mistral \ # Use Mistral Vision AI |
| 60 | + --chart-type scatter \ # Force chart type |
| 61 | + --x-scale log \ # Log scale axes |
| 62 | + --crop 50,30,750,620 \ # Manual crop |
| 63 | + --overlay proof.png # Visual verification |
| 64 | +``` |
| 65 | + |
| 66 | +### Honest Confidence Scoring |
| 67 | +| Zone | Score | Meaning | |
| 68 | +|------|-------|---------| |
| 69 | +| 🟢 High | ≥0.7 | Use data confidently | |
| 70 | +| 🟡 Medium | 0.4-0.7 | Check overlay | |
| 71 | +| 🔴 Low | <0.4 | Use `--calibrate` | |
| 72 | + |
| 73 | +## 📊 Supported Charts |
37 | 74 |
|
38 | 75 | - ✅ Scatter plots |
39 | | -- ✅ Line plots (single line) |
40 | | -- ✅ Bar charts (simple columns) |
41 | | -- ✅ Linear scales only |
42 | | -- ⏳ Log scale (via manual calibration) |
43 | | -- ❌ Multi-series (roadmap) |
44 | | -- ❌ Dual-axis (roadmap) |
45 | | -- ❌ Stacked bars (roadmap) |
46 | | - |
47 | | -## Key Features |
48 | | - |
49 | | -### MVP (v0.1.0) |
50 | | -1. **PNG/JPG input** - Standard image formats |
51 | | -2. **Auto-detection** - Plot area, axes, tick labels (best-effort) |
52 | | -3. **Manual overrides** - `--crop`, `--x-axis`, `--y-axis` when auto fails |
53 | | -4. **OCR tick labels** - Tesseract-based number recognition |
54 | | -5. **CSV/JSON export** - Clean data + metadata |
55 | | -6. **Overlay generation** - Visual proof of extraction |
56 | | -7. **Confidence scoring** - 0.0-1.0 with clear zones (high/medium/low) |
57 | | -8. **Warning system** - Honest diagnostics (OCR_FAILED, POSSIBLE_LOG_SCALE, etc.) |
58 | | -9. **Calibration fallback** - Numeric input mode when auto fails |
59 | | -10. **Benchmark mode** - Measure quality on your own fixtures |
60 | | - |
61 | | -### Not in MVP |
62 | | -- Multi-series + legend parsing |
63 | | -- Dual-axis charts |
64 | | -- Auto log-scale detection |
65 | | -- Click-based calibration UI |
66 | | -- PDF multi-page auto |
67 | | -- Web UI / API / Telegram bot |
68 | | -- Automatic rotation correction |
| 76 | +- ✅ Line charts |
| 77 | +- ✅ Bar charts |
| 78 | +- ✅ Linear & Log scales |
| 79 | +- ⏳ Multi-series (roadmap) |
| 80 | +- ⏳ Dual-axis (roadmap) |
69 | 81 |
|
70 | | -## Philosophy |
| 82 | +## 🛠️ Philosophy |
71 | 83 |
|
72 | 84 | **Better to say "not sure" than give wrong data silently.** |
73 | 85 |
|
|
0 commit comments