sci-figure

Extract figures and sub-figures from academic PDF papers at configurable DPI.

2|Updated Aug 15, 2026
One-click install
npx skills add https://github.com/Jensen-Yao/agents-skills --skill sci-figure-jensen-yao
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: sci-figure
Source: https://github.com/Jensen-Yao/agents-skills/tree/main/skills/sci-figure
Command: npx skills add https://github.com/Jensen-Yao/agents-skills --skill sci-figure-jensen-yao

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pdfplumber, PyMuPDF, opencv-python, Pillow, pytesseract, numpy, and includes scripts (resource) components.

What problem does it solve? Academic papers embed figures inside PDFs, making it tedious to manually screenshot or crop charts, schemes, and sub-figure panels for reuse in presentations, notes, or analysis. ## Core Features & Use Cases - Automatic figure detection: Locates Figure/Fig./Scheme/Chart/Supplementary/Extended Data captions (including Chinese equivalents like 图/方案/补充图) and computes precise image boundaries using a three-engine pipeline (native PyMuPDF extraction, CV region detection, caption-anchored fallback). - Sub-figure splitting: Splits composite figures into labeled panels (a), (b), (c) using white-space analysis plus Tesseract or EasyOCR label recognition. - High-quality output: Renders at configurable DPI (default 600) in PNG or JPG, with whitespace trimming and text-only content rejection. - Use Case: Given a Nature paper PDF, run the CLI to list all figures, then extract Figure 2 sub-panel c as a publication-ready 600 DPI PNG. ## Quick Start Ask the agent to extract Figure 2 sub-figure c from paper.pdf into a PNG file using the sci-figure skill.

Frequently Asked Questions about sci-figure

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I extract figures from a PDF paper in Python?▼

Install the package with pip install -e ., then run sh-sci-fig paper.pdf -f 3 to extract Figure 3, or use --all to extract every figure. Output is saved as figure_3.png at 600 DPI by default.

How to extract a specific sub-figure panel from a composite figure?▼

Use the -s flag with the panel label, for example sh-sci-fig paper.pdf -f 2 -s c produces figure_2c.png. Sub-figure labels are detected via white-space grid analysis combined with Tesseract or EasyOCR recognition.

Does PDF figure extraction work with scanned documents?▼

The tool prioritizes vector-based PDFs where captions and embedded images are machine-readable. Scanned PDFs may fail because caption detection relies on text extraction via pdfplumber, which requires a real text layer.

Why does sub-figure splitting fail or return the whole figure?▼

Splitting fails when OCR cannot recognize panel labels or no consecutive label sequence starting from (a) is found. In that case the tool falls back to returning the entire figure region with a warning instead of an incorrect crop.

What OCR engines are supported for sub-figure label detection?▼

Tesseract is the default OCR engine and must be installed separately. EasyOCR is available as an optional alternative via pip install sci-figure[ocr] and can be selected with --ocr easyocr, or OCR can be disabled with --ocr none.

Can I manually correct a wrong figure crop?▼

Yes, use --render-page with --annotate to generate an annotated page image showing detected bounding boxes, then re-extract with --bbox x0,y0,x1,y1 and --page to specify exact pixel coordinates for the crop.