← 返回 Skills 市场
jumeng1997

批量图像处理工具

作者 JuMeng1997 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
302
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install imutils-skill
功能描述
基于imutils库,实现图片批量旋转、缩放、平移、骨架化及图片列表列出功能,支持多场景图像处理。
使用说明 (SKILL.md)

imutils-skill - 批量图像处理 Skill

📸 基于 PyImageSearch/imutils 的批量图像处理工具

⭐ 原项目:https://github.com/PyImageSearch/imutils (4.6k stars)


🎯 功能

批量处理图片:

  • ✅ 旋转图片(任意角度)
  • ✅ 缩放图片(指定尺寸或比例)
  • ✅ 平移图片(X/Y 轴移动)
  • ✅ 骨架化(图像预处理)
  • ✅ 批量列出图片

适用场景:

  • 📦 电商产品图批量处理
  • 📱 社交媒体配图批量调整
  • 🖼️ 摄影师作品集水印
  • 📊 数据增强(AI 训练图片)

🚀 快速开始

前提条件

  1. 已安装 CLI-Anything 和 imutils CLI

    # 如果还没安装,运行:
    cd E:\AI-Tools\CLI-Anything\CLI-Anything\imutils\agent-harness
    pip install -e .
    
  2. Python 3.10+

  3. 依赖包: opencv-python, numpy, imutils

安装 Skill

# 方法 1:从 GitHub 安装(推荐)
npx skills add your-github-username/openclaw-skill-imutils

# 方法 2:本地安装
npx skills add E:\AI-Tools\CLI-Anything\openclaw-skill-imutils

使用示例

1️⃣ 旋转图片

/rotate-image --input photo.jpg --output rotated.jpg --angle 90

参数:

  • --input - 输入图片路径(必需)
  • --output - 输出图片路径(必需)
  • --angle - 旋转角度,默认 0(可选)
  • --scale - 缩放比例,默认 1.0(可选)

示例:

/rotate-image --input cactus.jpg --output cactus_90.jpg --angle 90

2️⃣ 缩放图片

/resize-image --input photo.jpg --output small.jpg --width 800 --height 600

参数:

  • --input - 输入图片路径(必需)
  • --output - 输出图片路径(必需)
  • --width - 目标宽度(可选,0=自动计算)
  • --height - 目标高度(可选,0=自动计算)
  • --interpolation - 插值方法:nearest|bilinear|cubic|area|lanczos,默认 area(可选)

示例:

# 缩放到 800x600
/resize-image --input photo.jpg --output small.jpg --width 800 --height 600

# 等比例缩放(只指定宽度)
/resize-image --input photo.jpg --output small.jpg --width 800

# 等比例缩放(只指定高度)
/resize-image --input photo.jpg --output small.jpg --height 600

3️⃣ 平移图片

/translate-image --input photo.jpg --output shifted.jpg --x 50 --y 30

参数:

  • --input - 输入图片路径(必需)
  • --output - 输出图片路径(必需)
  • --x - X 轴平移像素,默认 0(可选)
  • --y - Y 轴平移像素,默认 0(可选)

示例:

# 向右平移 50 像素,向下平移 30 像素
/translate-image --input photo.jpg --output shifted.jpg --x 50 --y 30

4️⃣ 骨架化

/skeletonize --input photo.jpg --output skeleton.jpg

参数:

  • --input - 输入图片路径(必需)
  • --output - 输出图片路径(必需)

示例:

/skeletonize --input text.png --output text_skeleton.png

5️⃣ 批量列出图片

/list-images --folder ./photos --ext .jpg

参数:

  • --folder - 图片文件夹路径(必需)
  • --ext - 图片扩展名,默认 .jpg(可选)

示例:

/list-images --folder E:\客户图片 --ext .jpg

💼 批量处理脚本

场景 1:批量旋转 90 度

批量旋转当前文件夹所有图片 90 度,输出到 rotated/ 文件夹

AI 会执行:

New-Item -ItemType Directory -Path "rotated" -Force
$files = Get-ChildItem "*.jpg"
foreach ($file in $files) {
    $output = "rotated/" + $file.Name
    /rotate-image --input $file.FullName --output $output --angle 90
}

场景 2:批量缩放到社交媒体尺寸

把所有图片缩放到微信公众号封面尺寸(900x383)

AI 会执行:

New-Item -ItemType Directory -Path "wechat" -Force
$files = Get-ChildItem "*.jpg"
foreach ($file in $files) {
    $output = "wechat/" + $file.Name
    /resize-image --input $file.FullName --output $output --width 900 --height 383
}

场景 3:批量添加边框(平移实现)

给所有图片添加 50 像素的白色边框

AI 会执行:

New-Item -ItemType Directory -Path "bordered" -Force
$files = Get-ChildItem "*.jpg"
foreach ($file in $files) {
    # 先缩放图片(缩小)
    $temp = "temp_" + $file.Name
    /resize-image --input $file.FullName --output $temp --width 700 --height 700
    # 再平移(创造边框效果)
    $output = "bordered/" + $file.Name
    /translate-image --input $temp --output $output --x 50 --y 50
    Remove-Item $temp
}

📊 性能参考

任务 图片数量 用时 收费参考
批量旋转 100 张 1-2 分钟 ¥500-800
批量缩放 500 张 3-5 分钟 ¥1500-2500
批量平移 200 张 2-3 分钟 ¥800-1200
混合处理 1000 张 10-15 分钟 ¥3000-5000

注:性能取决于 CPU 和图片大小,收费参考市场价


🔧 技术细节

CLI 实现

本 Skill 封装了 cli-anything-imutils 命令行工具:

# 核心依赖
from imutils import rotate, resize, translate, skeletonize
import cv2
import numpy as np

文件结构

openclaw-skill-imutils/
├── SKILL.md              # 本文件
├── scripts/
│   ├── rotate.js         # 旋转脚本
│   ├── resize.js         # 缩放脚本
│   ├── translate.js      # 平移脚本
│   └── skeleton.js       # 骨架化脚本
└── references/
    └── imutils-docs.md   # 参考文档

📚 参考资源


🤝 贡献

欢迎提交 Issue 和 PR!

作者: Boss(通过 AI 辅助开发)
AI 助手: Jarvis (OpenClaw)
发布日期: 2026-03-14


📝 更新日志

v1.0.0 (2026-03-14)

  • ✅ 初始版本
  • ✅ 实现旋转、缩放、平移、骨架化功能
  • ✅ 添加批量处理示例
  • ✅ 添加接单场景参考

💬 使用技巧

对 AI 这样说:

"用 imutils-skill 批量处理这些图片"
"把所有产品图旋转 90 度"
"缩放到微信公众号尺寸"
"给这 100 张图添加边框"

AI 会自动:

  1. 调用对应的命令
  2. 批量处理文件
  3. 输出到指定文件夹
  4. 报告处理结果

Happy Coding! 🎉

安全使用建议
This skill appears to implement batch image operations but has several red flags: documentation points to a developer-local pip path instead of a public installer; CLI names are inconsistent across docs and code; and the Node scripts call shell commands via execSync using user-supplied paths (risk of command injection). Before installing or running: 1) Ask the author for the canonical install instructions and the public source (GitHub URL) for the 'cli-anything-imutils' CLI. 2) Verify the external CLI's code and provenance; do not pip install from unknown local paths. 3) Inspect and, if possible, run the scripts in a sandboxed environment with non-sensitive test images. 4) Consider patching the Node scripts to use child_process.spawn/execFile with argument arrays or to properly sanitize/validate filenames to eliminate shell injection risk. 5) Confirm which exact command names are expected (e.g., '/rotate-image' vs 'imutils-rotate' vs 'cli-anything-imutils rotate-cmd') and that they map to trusted binaries. If you cannot validate the external CLI source or the author-provided install steps, treat this skill as untrusted and avoid running it on systems with sensitive files.
功能分析
Type: OpenClaw Skill Name: imutils-skill Version: 1.0.0 The skill bundle contains multiple shell injection vulnerabilities across all files in the `scripts/` directory (`resize.js`, `rotate.js`, `skeleton.js`, and `translate.js`). These scripts use `execSync` to execute commands by directly embedding unsanitized input parameters into shell strings, which could allow an attacker to execute arbitrary system commands. While the bundle appears intended for legitimate image processing using the `imutils` library, the lack of input validation and the inclusion of hardcoded local file paths (e.g., `E:\AI-Tools\`) in the documentation make it high-risk.
能力评估
Purpose & Capability
The skill claims to be a PyImageSearch/imutils-based tool, but the repository contains Node.js wrapper scripts that call an external CLI named 'cli-anything-imutils'. No Python CLI implementation or installer is bundled. Documentation asks the user to pip install a local path (E:\AI-Tools\...) which is a developer-specific path and not a public install source. CLI names are inconsistent across files and docs (e.g., SKILL.md examples use '/rotate-image' while package.json exposes 'imutils-rotate' and scripts call 'cli-anything-imutils rotate-cmd'). These inconsistencies are unexpected for a clean skill and reduce confidence that the requested pieces align with the described purpose.
Instruction Scope
SKILL.md instructs the agent to run batch PowerShell loops that list and call command-line tools to operate on files — this is within the stated purpose of batch processing images. However, the doc also instructs installing a local developer path (pip install -e . from a Windows path) and uses ambiguous command names (leading slash '/rotate-image') that don't match the actual script/command names. The PowerShell examples enumerate arbitrary files in the working directory; while expected for batch tasks, they mean the skill will access file system contents broadly when invoked.
Install Mechanism
There is no install spec provided. The SKILL.md asks users to pip install a CLI from a local, developer-specific path rather than a public package or repository. The skill's code relies on an external CLI ('cli-anything-imutils') that is not included here. That combination (no packaged installer + dependency on an out-of-repo CLI + developer local path) is incoherent and increases risk because it's unclear what exactly will be installed or executed on the host.
Credentials
The skill does not request environment variables or credentials (good). However, the Node scripts build shell commands using user-provided file paths and pass them to child_process.execSync as a single shell command string. Paths are quoted but not otherwise sanitized; this creates a command injection risk if a malicious or malformed filename/argument is provided. No network endpoints or secrets are requested, so there is no explicit credential exfiltration, but the use of unsanitized shell execution broadens the attack surface.
Persistence & Privilege
The skill does not request persistent privileges (always: false). It does not modify other skills or system-wide settings. Autonomy (disable-model-invocation false) is normal and not by itself a concern, and the skill does not request 'always: true'.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install imutils-skill
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /imutils-skill 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
imutils-skill v1.0.0 - 初始版本发布 - 支持批量旋转、缩放、平移、骨架化等图像处理 - 提供批量处理 PowerShell 脚本示例 - 适用于电商、社交媒体、摄影和数据增强场景 - 附使用说明、性能与应用场景参考
元数据
Slug imutils-skill
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

批量图像处理工具 是什么?

基于imutils库,实现图片批量旋转、缩放、平移、骨架化及图片列表列出功能,支持多场景图像处理。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 302 次。

如何安装 批量图像处理工具?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install imutils-skill」即可一键安装,无需额外配置。

批量图像处理工具 是免费的吗?

是的,批量图像处理工具 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

批量图像处理工具 支持哪些平台?

批量图像处理工具 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 批量图像处理工具?

由 JuMeng1997(@jumeng1997)开发并维护,当前版本 v1.0.0。

💬 留言讨论