← 返回 Skills 市场
163
总下载
0
收藏
1
当前安装
1
版本数
在 OpenClaw 中安装
/install image-converter
功能描述
图片格式转换工具。支持PNG、JPG、WEBP、SVG等格式互转。Use when user needs to convert image formats. 图片转换、格式转换、PNG转JPG、JPG转PNG。
使用说明 (SKILL.md)
图片格式转换工具
支持PNG、JPG、WEBP、SVG等格式互转。
功能特点
- 🖼️ 多格式支持:PNG/JPG/WEBP/SVG/GIF/BMP
- 🔄 双向转换:任意格式互转
- 📦 批量转换:一次转换多个文件
- 🎨 质量可控:自定义压缩质量
- ⚡ 快速转换:本地处理,无需网络
支持格式
| 格式 | 输入 | 输出 | 说明 |
|---|---|---|---|
| PNG | ✅ | ✅ | 无损压缩 |
| JPG | ✅ | ✅ | 有损压缩 |
| WEBP | ✅ | ✅ | 现代格式 |
| SVG | ⚠️ | ✅ | 矢量图 |
| GIF | ✅ | ✅ | 动图 |
| BMP | ✅ | ✅ | 位图 |
使用方式
User: "把这张PNG转成JPG"
Agent: 转换图片格式
User: "把这些图片都转成WEBP"
Agent: 批量转换
User: "JPG转SVG"
Agent: 转换为矢量图
Python代码
from PIL import Image
import os
class ImageConverter:
def __init__(self):
self.formats = {
'png': 'PNG',
'jpg': 'JPEG',
'jpeg': 'JPEG',
'webp': 'WEBP',
'gif': 'GIF',
'bmp': 'BMP'
}
def convert(self, input_path, output_path, quality=95):
"""转换图片格式"""
img = Image.open(input_path)
# 获取输出格式
ext = os.path.splitext(output_path)[1].lower().replace('.', '')
if ext in ['jpg', 'jpeg']:
# JPG需要RGB
if img.mode in ('RGBA', 'LA', 'P'):
img = img.convert('RGB')
img.save(output_path, 'JPEG', quality=quality)
elif ext == 'png':
img.save(output_path, 'PNG')
elif ext == 'webp':
img.save(output_path, 'WEBP', quality=quality)
elif ext == 'gif':
img.save(output_path, 'GIF')
elif ext == 'bmp':
img.save(output_path, 'BMP')
else:
img.save(output_path)
return output_path
def batch_convert(self, input_dir, output_dir, target_format='jpg', quality=95):
"""批量转换"""
os.makedirs(output_dir, exist_ok=True)
results = []
for filename in os.listdir(input_dir):
if filename.lower().endswith(('.png', '.jpg', '.jpeg', '.webp', '.gif', '.bmp')):
input_path = os.path.join(input_dir, filename)
output_filename = os.path.splitext(filename)[0] + f'.{target_format}'
output_path = os.path.join(output_dir, output_filename)
try:
self.convert(input_path, output_path, quality)
results.append({'file': filename, 'status': 'success'})
except Exception as e:
results.append({'file': filename, 'status': 'error', 'error': str(e)})
return results
# 使用示例
converter = ImageConverter()
converter.convert('input.png', 'output.jpg', quality=95)
Notes
- 本地处理,无需网络
- 支持批量转换
- PNG转JPG会丢失透明度
- SVG输出需要cairosvg
安全使用建议
This skill appears to do what it says: local image conversions using Python + Pillow and CairoSVG. Before using, consider: (1) only give it access to the specific files or directories you want converted — avoid pointing it at system or sensitive folders; (2) if the agent will pip-install dependencies, run that in a contained environment (virtualenv/container) if you have security concerns; (3) SVG-to-raster or raster-to-SVG conversions may change image fidelity and lose transparency (not a security issue, but expected behavior). If you need stricter file access controls, run the provided Python code yourself in a controlled environment rather than allowing autonomous execution.
功能分析
Type: OpenClaw Skill
Name: image-converter
Version: 1.0.0
The image-converter skill bundle is a legitimate tool for converting image formats using the Pillow and cairosvg libraries. The Python code in SKILL.md implements standard image processing and batch conversion logic without any evidence of malicious intent, data exfiltration, or suspicious network activity.
能力评估
Purpose & Capability
Name/description (image format conversion) align with requirements: python3 binary and the pip packages pillow and cairosvg are appropriate for raster/SVG conversions. No unrelated credentials, binaries, or config paths are requested.
Instruction Scope
SKILL.md provides concrete Python code to open, convert, and batch-process files in user-specified directories — this is expected. Note: the instructions operate on arbitrary file paths provided to the agent (read/write). That is normal for a conversion tool, but means the agent will need access to any directories/files you ask it to convert; the skill does not include path restrictions or explicit sanitization.
Install Mechanism
This is an instruction-only skill with no install spec. The metadata lists 'pip install pillow cairosvg' which is proportional and expected for the stated functionality. These are well-known packages; no external download URLs or archive extraction are used.
Credentials
No environment variables, credentials, or unrelated config paths are requested. The scope of access is limited to file I/O for images, which matches the stated purpose.
Persistence & Privilege
Skill is not always-enabled and does not request elevated or persistent platform privileges. It does not modify other skills or global agent configuration.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install image-converter - 安装完成后,直接呼叫该 Skill 的名称或使用
/image-converter触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
图片格式转换工具:支持PNG/JPG/WEBP/SVG/GIF/BMP互转,批量转换,质量可控
元数据
常见问题
Image Converter 是什么?
图片格式转换工具。支持PNG、JPG、WEBP、SVG等格式互转。Use when user needs to convert image formats. 图片转换、格式转换、PNG转JPG、JPG转PNG。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 163 次。
如何安装 Image Converter?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install image-converter」即可一键安装,无需额外配置。
Image Converter 是免费的吗?
是的,Image Converter 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Image Converter 支持哪些平台?
Image Converter 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Image Converter?
由 ToBeWin(@tobewin)开发并维护,当前版本 v1.0.0。
推荐 Skills