con un clic
extract-paper-images
从论文中提取图片,优先从arXiv源码包获取真正的论文图
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Menú
从论文中提取图片,优先从arXiv源码包获取真正的论文图
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Basado en la clasificación ocupacional SOC
深度分析单篇论文,生成详细笔记和评估,图文并茂 / Deep analyze a single paper, generate detailed notes with images
论文阅读工作流启动 - 生成今日论文推荐笔记 / Paper reading workflow starter - Generate daily paper recommendations
| name | extract-paper-images |
| description | 从论文中提取图片,优先从arXiv源码包获取真正的论文图 |
| allowed-tools | Read, Write, Bash |
You are the Paper Image Extractor for OrbitOS.
在执行任何脚本之前,先解析 conda 环境:
# Resolve OBSIDIAN_VAULT_PATH
if [ -z "$OBSIDIAN_VAULT_PATH" ]; then
[ -f "$HOME/.zshrc" ] && source "$HOME/.zshrc" 2>/dev/null || true
[ -f "$HOME/.bash_profile" ] && source "$HOME/.bash_profile" 2>/dev/null || true
fi
if [ -z "$OBSIDIAN_VAULT_PATH" ]; then
OBSIDIAN_VAULT_PATH="$HOME/Documents/Obsidian Vault"
fi
# Resolve Python from paper conda environment
CONDA_ENV=$(grep -E "^\s+conda_env:" "$OBSIDIAN_VAULT_PATH/99_System/Config/research_interests.yaml" 2>/dev/null | awk '{print $2}' | tr -d '"')
if [ -z "$CONDA_ENV" ]; then CONDA_ENV="paper"; fi
PYTHON="$HOME/anaconda3/envs/$CONDA_ENV/bin/python"
if [ ! -f "$PYTHON" ]; then
PYTHON="python"
fi
从论文中提取所有图片,保存到论文笔记/[论文标题]/images/目录,并返回图片路径列表,以便在笔记中引用。
关键改进:优先从arXiv源码包提取真正的论文图片(架构图、实验结果图等),而非PDF中的logo等非核心图片。
识别论文来源
下载PDF(如果需要)
脚本会自动尝试以下步骤:
下载arXiv源码包
https://arxiv.org/e-print/[PAPER_ID]查找源码中的图片目录
pics/、figures/、fig/、images/、img/提取源码中的PDF图片
dr_pipelinev2.pdf)生成图片索引
如果源码包不可用或未找到足够图片,回退到从PDF中提取:
$PYTHON "scripts/extract_images.py" \
"[PAPER_ID or PDF_PATH]" \
"$OBSIDIAN_VAULT_PATH/论文笔记/[DOMAIN]/[PAPER_TITLE]/images" \
"$OBSIDIAN_VAULT_PATH/论文笔记/[DOMAIN]/[PAPER_TITLE]/images/index.md"
参数说明:
返回相对于笔记文件的图片路径列表,格式化输出便于在笔记中引用。
PDF直接提取的问题:
当源码包中无图片文件且 PDF 中无嵌入式图片时(常见于纯 TikZ 论文):
.tex 文件中搜索 \begin{tikzpicture} 或 \usepackage{pgfplots}.pdf figure 文件.pdf 转为 .pngimport fitz
doc = fitz.open('paper.pdf')
for page in doc:
blocks = page.get_text('blocks')
# Find caption position (e.g., "Figure 1:")
for b in blocks:
if 'Figure' in b[4] and ':' in b[4]:
caption_bottom = b[3]
# Crop from figure top to caption bottom
clip = fitz.Rect(margin, fig_top, page.rect.width - margin, caption_bottom + 5)
pix = page.get_pixmap(matrix=fitz.Matrix(3, 3), clip=clip)
pix.save(f'{output_dir}/{paper_id}_fig{n}.png')
arXiv源码包的优势:
pics/目录包含作者准备的原始图片dr_pipelinev2.pdf)# 图片索引
总计:X 张图片
## 来源: arxiv-source
- 文件名:final_results_combined.pdf
- 路径:images/final_results_combined_page1.png
- 大小:1500.5 KB
- 格式:png
## 来源: pdf-figure
- 文件名:dr_pipelinev2_page1.png
- 路径:images/dr_pipelinev2_page1.png
- 大小:45.2 KB
- 格式:png
## 来源: pdf-extraction
- 文件名:page1_fig15.png
- 路径:images/page1_fig15.png
- 大小:65.3 KB
- 格式:png
Image paths:
images/final_results_combined_page1.png (arxiv-source)
images/dr_pipelinev2_page1.png (pdf-figure)
images/rl_framework_page1.png (pdf-figure)
images/question_synthesis_pipeline_page1.png (pdf-figure)
/extract-paper-images 2510.24701
论文笔记/领域/论文标题/images/论文笔记/领域/论文标题/images/index.mdimages/final_results_combined_page1.png等(前3-5张)论文笔记/[领域]/[论文标题]/images/如果提取的都是logo/图标:
pics/或figures/目录如果arXiv源码包下载失败: