image-batch-processor

An image batch processing toolbox. Used for bulk format conversion (e.g., PNG/JPG/HEIC/LIVP/CR2/ARW/NEF/WebP/TIFF/SVG/PDF), adding text or image watermarks, compression, OCR text extraction, horizontal/vertical stitching into long images, row/column splitting, grayscale adjustments, pixel- or percentage-based scaling, rotation and flipping, blur-to-high‑resolution/super‑resolution enhancement and deblurring, and background removal. Suitable for requests like "convert images to xxx format", "add a watermark", "compress images", "extract text from this image", "stitch into a long image", "split into a 3x3 grid", "make a blurry image clear", and "remove background".

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "image-batch-processor" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-addae44179b56c1ba405bd8be4683253f2af14c2bf7b181426d7e9b2818affd2. Verify the upstream source and version against https://skillhub.cn/skills/user_c208e969/image-batch-processor before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

An image batch processing toolbox. Used for bulk format conversion (e.g., PNG/JPG/HEIC/LIVP/CR2/ARW/NEF/WebP/TIFF/SVG/PDF), adding text or image watermarks, compression, OCR text extraction, horizontal/vertical stitching into long images, row/column splitting, grayscale adjustments, pixel- or percentage-based scaling, rotation and flipping, blur-to-high‑resolution/super‑resolution enhancement and deblurring, and background removal. Suitable for requests like "convert images to xxx format", "add a watermark", "compress images", "extract text from this image", "stitch into a long image", "split into a 3x3 grid", "make a blurry image clear", and "remove background".

0 Downloads

Introduction source: third_party · user_c208e969 · 1.0.0 Reference

SkillPi interpretation

Tasks
Translation pending; see source documentation.
Audience
Translation pending; see source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: image-batch-processor
description: 图片批量处理工具箱。当用户需要批量处理图片时使用:格式互转(PNG/JPG/HEIC/LIVP/CR2/ARW/NEF/WebP/TIFF/SVG/PDF 等)、添加文字或图片水印、压缩体积、OCR 提取文字、水平/垂直拼接长图、按行列拆分、灰度调整、按像素或百分比缩放、旋转、水平/垂直翻转、模糊转高清/超分放大、图片背景去除。适用于"把图片转成xxx格式""加个水印""压缩一下图片""提取这张图里的文字""拼成长图""把大图分成九宫格""让模糊图片变清晰""抠图去背景"等请求。
agent_created: true

Image Batch Processor(图片批量处理工具箱)

Overview

一个面向批量图片处理的单文件 CLI 技能,覆盖截图工具类网站常见的十二类操作:格式互转、水印、压缩、OCR 文字提取、长图拼接、网格拆分、灰度、缩放、旋转、翻转、模糊转高清/超分放大、图片背景去除。所有操作均支持批量(目录 / 通配符),失败时跳过并汇总,不中断整体任务。

核心脚本:scripts/image_batch_processor.py(基于 Pillow,可选依赖按需启用)。

When to use

触发词与场景示例:

  • 格式转换:「把 PNG 转成 JPG」「HEIC 转 JPG」「LIVP/CR2/ARW/NEF 转 JPG」「其它格式互转」「导出成 WebP/PDF/TIFF」
  • 水印:「给这些图加个文字水印」「批量打 logo 水印」
  • 压缩:「压缩图片节省空间,又不要糊」「批量压到 70 质量」
  • OCR:「提取图片上的文字」「批量识别截图里的字」
  • 拼接:「把这些图拼成一张长图」「水平拼接 / 垂直拼接」
  • 拆分:「把大图平均分成 3×3 小图」「九宫格切图」
  • 灰度:「调一下灰度」「去色但保留一点原色」
  • 缩放:「按像素改成 800 宽」「按比例缩到 50%」「改成 1920×1080」
  • 旋转 / 翻转:「旋转 90 度」「水平翻转」「垂直翻转」
  • 高清增强:「把这张模糊图变清晰」「超分放大 2 倍」「图片模糊转高清」
  • 背景去除:「抠图」「去掉背景」「把人物从背景里扣出来」

Dependencies(运行前确认)

  • 必需:Pillow(py3)
    pip install Pillow
  • 按需(首次用到对应格式时报错并提示安装):
    • HEIC / HEIF → pillow-heif
    • RAW(CR2/CR3/NEF/ARW/DNG)→ rawpy
    • SVG 输入 → cairosvg
    • OCR → pytesseract + 系统安装 Tesseract(中文包 chi_sim)
    • 多页图片转 PDF → img2pdf
    • 背景去除 → rembg(基于 ONNX Runtime,效果最好)
    • AI 超分高清 → realesrgan + numpy + 对应 .pth 模型文件

建议在虚拟环境或隔离目录安装,避免污染用户环境。

Workflow

  1. 确认输入:拿到图片路径 / 目录 / 通配符,确认目标操作与参数。
  2. 确认依赖:根据目标格式检查 Pillow 及可选依赖;缺失则先安装再执行。
  3. 执行脚本:调用 scripts/image_batch_processor.py 对应子命令。可用 --out 指定输出目录,否则默认写入 <输入目录>/<操作>_output。
  4. 汇总反馈:报告成功/跳过数量与输出路径;对跳过的文件说明原因(格式不支持 / 依赖缺失 / 解码失败)。

脚本统一入口:

python scripts/image_batch_processor.py <子命令> <输入...> [选项]

Operations(子命令速查)

convert — 格式互转

python scripts/image_batch_processor.py convert "*.png" --format jpg --quality 92
python scripts/image_batch_processor.py convert ./raw/ --format webp --recursive
python scripts/image_batch_processor.py convert photo.heic --format jpg   # 需 pillow-heif
  • --format:目标格式(jpg/png/gif/bmp/webp/tiff/ico/pdf/svg/heic/heif/psd…)
  • --quality:有损格式质量(1-100,默认 95)
  • 转 JPEG 时自动把 RGBA/P 模式压平为 RGB;转 ICO 默认 256×256。

watermark — 文字 / 图片水印

python scripts/image_batch_processor.py watermark "*.jpg" --text "© 2026" --opacity 0.6 --position bottomright
python scripts/image_batch_processor.py watermark "*.png" --logo ./logo.png --scale 0.2
  • --text / --logo 可单独或同时用。
  • --scale:logo 相对图片宽度的比例(默认 0.2)。
  • --opacity:文字透明度 0-1。
  • --position:center / topleft / topright / bottomleft / bottomright。

compress — 压缩

python scripts/image_batch_processor.py compress ./photos/ --quality 70
  • --quality:JPEG 质量(默认 70),打印压缩前后体积与节省比例。

ocr — 提取文字

python scripts/image_batch_processor.py ocr ./scans/ --lang chi_sim+eng
  • 每张图输出同名 .txt;需 pytesseract + Tesseract 引擎。

stitch — 拼接长图

python scripts/image_batch_processor.py stitch 1.png 2.png 3.png --direction vertical --name long.png
python scripts/image_batch_processor.py stitch ./slides/ --direction horizontal
  • --direction:vertical(默认)/ horizontal;拼接前统一对齐边。

split — 网格拆分

python scripts/image_batch_processor.py split big.png --rows 3 --cols 3
  • 输出 <原图名>_行_列.png,如 big_1_1.png … big_3_3.png。

grayscale — 灰度调整

python scripts/image_batch_processor.py grayscale "*.jpg" --level 50
  • --level:0=纯灰,100=原色(默认 50)。

resize — 缩放

python scripts/image_batch_processor.py resize "*.png" --width 800
python scripts/image_batch_processor.py resize "*.png" --percent 50
python scripts/image_batch_processor.py resize "*.png" --width 1920 --height 1080
  • 指定宽或高时按比例换算另一边;同时指定则强制目标尺寸。

rotate / flip — 旋转 / 翻转

python scripts/image_batch_processor.py rotate "*.jpg" --angle 90
python scripts/image_batch_processor.py flip "*.jpg" --direction horizontal

enhance — 模糊转高清 / 超分放大

python scripts/image_batch_processor.py enhance blurry.jpg --scale 2
python scripts/image_batch_processor.py enhance ./low_res/ --scale 4 --model RealESRGAN_x4plus.pth
  • --scale:放大倍数 2/3/4(默认 2)。
  • --model:可选 Real-ESRGAN 模型路径;未提供则使用 Pillow LANCZOS + 非锐化掩膜的基础增强。
  • --model-arch:general(默认)/ anime。

removebg — 背景去除

python scripts/image_batch_processor.py removebg photo.jpg
python scripts/image_batch_processor.py removebg ./products/ --tolerance 25
  • 优先使用 rembg(AI 抠图,效果最佳);未安装时自动回退到「四角取色 + 颜色容差」简单抠图。
  • --tolerance:回退模式下背景颜色容差(默认 30)。
  • 输出统一为 PNG(保留透明通道)。

Notes & Edge Cases

  • 批量稳健性:每张图独立 try/except,单张失败不影响其余;最终汇总成功与跳过数。
  • 特殊格式:HEIC/RAW/SVG 在缺失可选依赖时给出明确 pip 安装提示,而非静默失败。
  • 输出安全:默认写入独立输出目录,绝不在原文件上覆盖;需要时由用户显式指定 --out。
  • 中文路径/水印:脚本使用系统字体(Windows msyh.ttc、macOS PingFang.ttc 等),缺失时回退默认字体,文字水印仍可用。
  • PDF 输出:单图转单页 PDF;多页 PDF 可后续结合 img2pdf 增强(见 Dependencies)。
  • 高清增强:默认提供 Pillow 基础超分锐化(无需额外依赖);如需 Real-ESRGAN 效果,用户需自行下载对应 .pth 模型并通过 --model 指定。
  • 背景去除:AI 模式依赖 rembg 与 ONNX Runtime,首次安装可能较大;简单背景可依赖无依赖回退模式。

Current listing version

1.0.0

Verify the source revision ↗

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value95/100

Highlights

  • 覆盖十二类高频图片处理操作,满足批量处理刚需
  • 支持多种专业格式(HEIC/RAW/SVG/PDF)与AI增强功能
  • 具备稳健的错误处理机制,单张失败不影响整体任务
Trigger Precision92/100

Highlights

  • 触发词覆盖全面,列举典型用户表达变体
  • 边界清晰,不易与其他Skill混淆
Structure and Standards85/100

Areas to improve

  • 缺少明确的出口条件描述 Reported severity: Minor

    Workflow中未明确说明用户确认输出路径或参数后的执行出口条件

    Recommendation: 在Workflow步骤中补充出口条件,如“当用户确认输出目录与参数后,执行脚本并生成汇总报告”

Highlights

  • Phase划分清晰,包含输入确认、依赖检查、执行与反馈闭环
  • 提供丰富的端到端操作示例
  • frontmatter完整,单文件结构良好
Execution Reliability90/100

Highlights

  • 依赖管理明确,缺失时给出具体安装提示
  • 输出安全机制完善,默认不覆盖原文件
  • 批量处理具备容错能力,失败文件可汇总反馈
Evidence Verifiability (mean of the first four)91/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

  • Install or fetch external dependencies

    Use official sources and pin versions. Check install scripts in an isolated environment. This document check does not cover code downloaded later.

    Mentioned in main document · lines 35
Domains or addresses referenced in the document

These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.

  • github.com

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.