← Back to Skills Marketplace
Image Optimizer Tool
by
utopiabenben
· GitHub ↗
· v1.0.0
· MIT-0
325
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install image-optimizer-tool
Description
图片批量压缩和格式转换工具,支持批量调整大小、压缩质量、转换格式,预览模式和撤销功能!
README (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 不支持
- 大图片处理可能需要较长时间
Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install image-optimizer-tool - After installation, invoke the skill by name or use
/image-optimizer-tool - Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
image-optimizer-tool 1.0.0
- 首次发布,支持图片批量压缩、调整大小与格式转换
- 提供预览模式与撤销功能,原文件自动备份
- 支持递归处理子文件夹中的图片
- 命令行参数灵活,可定制目录、输出格式和质量
- 支持 JPEG、PNG、WebP 等常见格式输入与输出
Metadata
Frequently Asked Questions
What is Image Optimizer Tool?
图片批量压缩和格式转换工具,支持批量调整大小、压缩质量、转换格式,预览模式和撤销功能!. It is an AI Agent Skill for Claude Code / OpenClaw, with 325 downloads so far.
How do I install Image Optimizer Tool?
Run "/install image-optimizer-tool" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Image Optimizer Tool free?
Yes, Image Optimizer Tool is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does Image Optimizer Tool support?
Image Optimizer Tool is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Image Optimizer Tool?
It is built and maintained by utopiabenben (@utopiabenben); the current version is v1.0.0.
More Skills