SuperAPI AI Directory

extract-paper-images

Design & creation

View repository

Updated 10-15 23:43

About this skill

Extract research document figures

Input identification

  1. Treat the parent directory of the current SKILL.md as .
  2. Resolve from OBSIDIAN_VAULT_PATH; when missing, require the user to provide the Vault path.
  3. Accept:
    • A valid arXiv ID, arXiv:ID, or arxiv.org link;
    • A public HTTP(S) URL that returns PDF content;
    • An existing local PDF.
  4. Non-arXiv web pages cannot be passed directly to the image script. First use paper-analyze/scripts/resolve_source.py; if it returns selected_pdf_url or local_pdf, then pass that value.
  5. Confirm the output directory is located at /20_Research/Papers///images. Existing images are kept by default unless the user requests a refresh.

Execution

<python> "<skill-dir>/scripts/extract_images.py" "<arxiv-id-or-pdf-url-or-local-pdf>" "<images-dir>" "<images-dir>/index.md"

The script automatically performs:

  • arXiv: source images take priority, figure PDFs in the source come next, and the paper PDF is the fallback.
  • Direct PDF URL: download to a temporary directory, then extract from the PDF.
  • Local PDF: extract directly, with no network access.

Verification

  1. Confirm that the files in index.md actually exist.
  2. Prioritize architecture, method, main results, and ablation figures; filter out logos, small icons, and duplicate content.
  3. Check PNG readability; do not recommend embedding when cropping is wrong or text is too small.
  4. Return the directory, index, count, and the 3–5 most valuable filenames.
  5. Obsidian uses ![[filename.png|800]].

Failure handling

  • URL returns HTML instead of PDF: stop and prompt to run the source resolver first; do not treat the URL as an arXiv ID.
  • Public download fails: report the HTTP status or content type; do not attempt to log in or bypass access controls.
  • Output path escapes the Vault: stop.
  • Do not delete existing images, and do not leave temporary downloads in the Vault.