← 返回 Skills 市场
utopiabenben

Image Optimizer Tool

作者 utopiabenben · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
325
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install image-optimizer-tool
功能描述
图片批量压缩和格式转换工具,支持批量调整大小、压缩质量、转换格式,预览模式和撤销功能!
使用说明 (SKILL.md)

image-optimizer - 图片批量压缩和格式转换工具

图片批量压缩和格式转换工具,支持多种操作模式,预览模式和撤销功能!

功能特性

  • 批量调整图片大小:按宽度、高度或最大尺寸等比例缩放
  • 批量压缩图片质量:可调节压缩级别(1-100)
  • 批量转换图片格式:PNG ↔ JPEG ↔ WebP 互转
  • 预览模式:不实际修改文件,只显示操作预览
  • 撤销功能:自动备份原始文件,支持一键撤销
  • 递归处理:支持处理子文件夹中的图片

安装

# 安装依赖
pip install Pillow

使用方法

基本用法

# 压缩当前目录下所有 JPEG 图片,质量 85
python source/image_optimizer.py --quality 85

# 调整图片宽度最大为 1920px
python source/image_optimizer.py --max-width 1920

# 转换所有图片为 WebP 格式
python source/image_optimizer.py --format webp

# 预览模式(不实际修改)
python source/image_optimizer.py --quality 80 --preview

# 撤销上次操作
python source/image_optimizer.py --undo

详细参数

--directory DIRECTORY, -d DIRECTORY
                        要处理的目录(默认:当前目录)
--quality QUALITY, -q QUALITY
                        压缩质量 1-100(默认:85)
--max-width MAX_WIDTH   最大宽度(像素)
--max-height MAX_HEIGHT 最大高度(像素)
--max-size MAX_SIZE     最大边长(像素,同时限制宽高)
--format {png,jpeg,webp}, -f {png,jpeg,webp}
                        输出格式
--recursive, -r         递归处理子文件夹
--preview, -p           预览模式,不实际修改文件
--undo, -u              撤销上次操作
--output-dir OUTPUT_DIR
                        输出目录(不覆盖原文件)
--extensions EXTENSIONS
                        要处理的文件扩展名,逗号分隔(默认:jpg,jpeg,png,webp)

示例

# 压缩当前目录所有图片,质量 80,最大宽度 1920px
python source/image_optimizer.py -q 80 --max-width 1920

# 转换为 WebP 格式并保存到新文件夹
python source/image_optimizer.py -f webp --output-dir ./optimized

# 递归处理所有子文件夹
python source/image_optimizer.py -q 75 -r

# 只处理 PNG 文件
python source/image_optimizer.py -q 90 --extensions png

支持的格式

  • 输入:JPEG, PNG, WebP, BMP, TIFF
  • 输出:JPEG, PNG, WebP

注意事项

  • 原始文件会自动备份到 ./.image_optimizer_backup/ 目录
  • 撤销功能只能撤销最近一次操作
  • WebP 格式支持透明度,JPEG 不支持
  • 大图片处理可能需要较长时间
安全使用建议
This skill appears to be what it claims: a local image batch optimizer. Before installing/running, note: 1) the script will read and overwrite image files you point it at unless you use --preview or --output-dir; 2) it automatically backs up originals to .image_optimizer_backup/ and writes .image_optimizer_log.json in the current directory — those backups may contain sensitive images and will consume disk space; 3) undo only restores the last recorded session; 4) run pip install Pillow in an appropriate Python environment (use a virtualenv) to avoid system-wide package changes; and 5) inspect the included files yourself before running if you have high security/privacy requirements. No network calls, secret exfiltration, or unrelated credential requests were found.
功能分析
Type: OpenClaw Skill Name: image-optimizer-tool Version: 1.0.0 The skill is a legitimate image optimization tool that uses the Pillow library for batch resizing, compression, and format conversion. The core logic in source/image_optimizer.py includes transparent safety features such as a local backup mechanism (.image_optimizer_backup) and an undo function, with no evidence of network activity, data exfiltration, or malicious command execution.
能力评估
Purpose & Capability
Name/description (batch image resizing, compression, format conversion) match the files and arguments present. The script performs resizing, format conversion, quality settings, preview and undo, and creates backups — all consistent with the stated purpose.
Instruction Scope
SKILL.md instructs running the included Python script and installing Pillow. The script acts on arbitrary directories/files the user points it at, creates backups in .image_optimizer_backup/ and writes a log file .image_optimizer_log.json in the working directory. This is expected for this tool but users should be aware these files contain originals and paths.
Install Mechanism
There is no remote download; install.sh and SKILL.md recommend pip install Pillow. No obscure URLs, archives, or executables are fetched. install.sh uses pip which is typical; users should run it in the intended Python environment (virtualenv) to avoid installing into the wrong interpreter.
Credentials
The skill requests no environment variables or credentials. It only requires local filesystem access to the directories you choose to process, which is appropriate for a file-manipulation tool.
Persistence & Privilege
always is false and the skill does not modify other skills or system agent settings. It persists backups and a log in the current working directory only (its own artifacts), which is normal for this utility.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install image-optimizer-tool
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /image-optimizer-tool 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
image-optimizer-tool 1.0.0 - 首次发布,支持图片批量压缩、调整大小与格式转换 - 提供预览模式与撤销功能,原文件自动备份 - 支持递归处理子文件夹中的图片 - 命令行参数灵活,可定制目录、输出格式和质量 - 支持 JPEG、PNG、WebP 等常见格式输入与输出
元数据
Slug image-optimizer-tool
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Image Optimizer Tool 是什么?

图片批量压缩和格式转换工具,支持批量调整大小、压缩质量、转换格式,预览模式和撤销功能!. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 325 次。

如何安装 Image Optimizer Tool?

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

Image Optimizer Tool 是免费的吗?

是的,Image Optimizer Tool 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Image Optimizer Tool 支持哪些平台?

Image Optimizer Tool 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Image Optimizer Tool?

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

💬 留言讨论