Extracts figures and sub-figures from academic PDF papers. Supports multiple figure types (Fig, Scheme, Supplementary Figure, Extended Data) and sub-figure labels. Outputs high-quality PNG at configurable DPI.
Ships in academic-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Precisely extract figures and sub-figures from academic PDF papers.
License note: sci-figure is licensed under AGPL-3.0-or-later because it links PyMuPDF (fitz), which is AGPL-licensed.
Install the package from the skill directory before first use:
cd ${SKILL_DIR}
pip install -e .
This registers the sh-sci-fig CLI command. Requires Tesseract OCR:
winget install UB-Mannheim.TesseractOCRapt install tesseract-ocrbrew install tesseractUse Bash to check EXTEND.md existence (priority order):
# Check project-level first
test -f .baoyu-skills/sci-figure/EXTEND.md && echo "project"
# Then user-level (cross-platform: $HOME works on macOS/Linux/WSL)
test -f "$HOME/.baoyu-skills/sci-figure/EXTEND.md" && echo "user"
EXTEND.md Supports: Default DPI | Default output format | Tesseract path
sh-sci-fig <input.pdf> [options]
| Option | Short | Description | Default |
|---|---|---|---|
<input> | PDF file path | Required | |
--figure | -f | Figure number (1, 2, 3...) | Required (except --list/--all) |
--subfigure | -s | Sub-figure label (a, b, c...) | None (returns whole figure) |
--output | -o | Output directory | Current directory |
--dpi | -d | Output resolution | 600 |
--list | -l | List all available figure numbers | false |
--all | Extract all figures | false | |
--format | Output format (png/jpg) | png | |
--strategy | Extraction strategy: hybrid/native/cv | hybrid | |
--ocr | OCR engine: tesseract/easyocr/none | tesseract | |
--render-page | Render full page with annotations | false | |
--annotate | Draw bounding boxes on rendered page | false | |
--bbox | Manual bbox override (x0,y0,x1,y1 in px) | None | |
--no-trim | Disable whitespace trimming | false | |
--debug | Enable debug logging | false | |
--quiet | -q | Suppress info messages | false |
# Extract Figure 2, sub-figure c
sh-sci-fig paper.pdf -f 2 -s c
# Extract entire Figure 3
sh-sci-fig paper.pdf -f 3
# List all available figures in a PDF
sh-sci-fig paper.pdf --list
# Extract all figures
sh-sci-fig paper.pdf --all
# Custom output directory and DPI
sh-sci-fig paper.pdf -f 2 -s c -o ./output/ -d 300
# Use EasyOCR for sub-figure label detection
sh-sci-fig paper.pdf --all --ocr easyocr
# CV-only strategy (skip native extraction)
sh-sci-fig paper.pdf --all --strategy cv
# Render page with annotated bounding boxes (debugging)
sh-sci-fig paper.pdf -f 1 --render-page --annotate
# Manual bbox extraction (multimodal correction)
sh-sci-fig paper.pdf -f 1 --bbox 100,200,800,1200
Output:
Extracted: figure_2c.png (1920x1080, 600 DPI)
| Scenario | Behavior |
|---|---|
| Figure number not found | Error + list all available figure numbers |
| OCR recognition failed | Return entire figure region |
| Sub-figure split failed | Return entire figure region |
| No sub-figure labels found | Return entire figure region |
| Library | Role |
|---|---|
| pdfplumber | Text + coordinate extraction (caption detection) |
| PyMuPDF (fitz) | Native image extraction + high-quality page rendering |
| opencv-python | CV region detection, connected-component analysis, content validation |
| Pillow | Final cropping, format conversion |
| pytesseract | OCR for sub-figure label recognition (default) |
| easyocr | Alternative OCR engine (optional, pip install sci-figure[ocr]) |
| numpy | Image array operations |
| Engine | Priority | Best For |
|---|---|---|
| Native (PyMuPDF) | 1st | Raster images embedded in PDF |
| CV (connected-component) | 2nd | Vector graphics, colored plots |
| Caption-anchored | 3rd | Fallback when above engines fail |
The hybrid strategy (default) tries all three in order and validates results.
Each figure returned by FigureExtractor.detect_all() is a dict with these keys:
| Field | Type | Description |
|---|---|---|
number | int | Figure number |
page | int | Page index (0-based) |
bbox_pdf | tuple | Crop region in PDF points (x0, y0, x1, y1) |
bbox_px | tuple | Crop region in pixels (x0, y0, x1, y1) |
caption_text | str | Full caption text |
figure_type | str | One of: figure, scheme, chart, supplementary, extended_data |
sublabels | list[str] | Sub-figure labels, e.g. ["a","b","c"] |
image | ndarray | Cropped figure image (numpy array) |
engine_used | str | Engine that produced the crop: native, cv, or fallback |
list_figures() returns the same dicts without the image field.
Custom configurations via EXTEND.md. See Preferences section for paths and supported options.
Aut_Sci_Write — Autonomous Scientific Writer
CHANGELOG.md (opens in a new tab)LICENSE (opens in a new tab)README.md (opens in a new tab)README_CN.md (opens in a new tab)_meta.json (opens in a new tab)requirements.txt (opens in a new tab)sci_figure.egg-info/PKG-INFO (opens in a new tab)sci_figure.egg-info/SOURCES.txt (opens in a new tab)sci_figure.egg-info/dependency_links.txt (opens in a new tab)sci_figure.egg-info/entry_points.txt (opens in a new tab)sci_figure.egg-info/requires.txt (opens in a new tab)sci_figure.egg-info/top_level.txt (opens in a new tab)sci_figure/__init__.py (opens in a new tab)sci_figure/annotator.py (opens in a new tab)sci_figure/caption_detector.py (opens in a new tab)sci_figure/cli.py (opens in a new tab)sci_figure/column_detector.py (opens in a new tab)sci_figure/exceptions.py (opens in a new tab)sci_figure/figure_extractor.py (opens in a new tab)sci_figure/image_processor.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
/academic-skills:sci-figurefrom academic-skills
npx claudepluginhub shzhao27208/aut_sci_write --plugin academic-skills9 skills in this plugin
/sci-download学术论文 PDF 下载。支持 8 个数据源:Elsevier、Springer Nature、IEEE Xplore、 arXiv、Unpaywall、Semantic Scholar、PubMed Central、知网(CNKI)。 自动根据 DOI 前缀路由到对应数据源,未知 DOI 自动尝试 Unpaywall → Semantic Scholar。
/sci-extractRead an academic paper end to end and extract professional research insights, figures, metadata, and critique. Use this skill whenever the user shares a scientific paper, review paper, survey paper, systematic review, meta-analysis, scoping review, arXiv link, DOI, PDF, or pasted paper text and asks to read, summarize, analyze, extract, digest, review, critique, or explain it. For original research papers, produce a modified Heilmeier analysis. For review literature, produce a field-map extraction covering scope, taxonomy, evidence quality, consensus, controversies, gaps, and future directions. Do NOT use this skill for non-academic articles, blog posts, or news./sci-htmlGenerate academic presentation-style HTML slide decks and browser reports from PDFs, structured text, Markdown, paper summaries, outlines, or research notes. Use whenever the user wants to convert a scientific paper PDF directly into an interactive HTML report, clickable web presentation, shareable browser deck, or PPT-like HTML output with figures, structured insights, section pages, and offline deck-directory output. In the Aut_Sci_Write suite, choose this skill when the user wants HTML/web output; choose sci-ppt when they explicitly need a .pptx file./sci-polishTwo-stage academic paper polishing skill. Stage A reduces AI detection traces (targeting GPTZero, Turnitin, Originality.ai). Stage B performs 8-dimension quality improvement (grammar, tone, coherence, conciseness, terminology, structure, argument clarity, journal compliance). Use whenever the user asks to polish, proofread, humanize, reduce AI rate, improve writing quality, or prepare a paper for submission.
/sci-pptGenerate professional academic PowerPoint (PPTX) presentations from paper PDFs, structured outlines, or plain text. Use for thesis defense, seminar reports, literature presentations, and graduate school applications. Supports automatic figure extraction, LaTeX formula rendering, and bilingual (Chinese/English) layouts./sci-reviewSpecialized workflows for drafting, refining, and responding to academic literature reviews and peer review feedback. Use this skill for literature review outlines, research-gap synthesis, reviewer rebuttals, response letters, and academic writing tone repair.Other plugins' skills for the same job