首页龙虾技能列表 › Image Converter

🖼️ Image Converter

v1.0.0

图片格式转换工具。支持PNG、JPG、WEBP、SVG等格式互转。Use when user needs to convert image formats. 图片转换、格式转换、PNG转JPG、JPG转PNG。

0· 115·1 当前·1 累计
by @tobewin (ToBeWin)·MIT-0
下载技能包
License
MIT-0
最后更新
2026/3/30
安全扫描
VirusTotal
无害
查看报告
OpenClaw
安全
high confidence
The skill's requirements and instructions match its stated purpose (local image format conversion); nothing requested is disproportionate or unrelated.
评估建议
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 secur...
详细分析 ▾
用途与能力
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.
指令范围
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.
安装机制
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.
凭证需求
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.
持久化与权限
Skill is not always-enabled and does not request elevated or persistent platform privileges. It does not modify other skills or global agent configuration.
安全有层次,运行前请审查代码。

License

MIT-0

可自由使用、修改和再分发,无需署名。

运行时依赖

无特殊依赖

版本

latestv1.0.02026/3/30

图片格式转换工具:支持PNG/JPG/WEBP/SVG/GIF/BMP互转,批量转换,质量可控

● 无害

安装命令 点击复制

官方npx clawhub@latest install image-converter
镜像加速npx clawhub@latest install image-converter --registry https://cn.clawhub-mirror.com

技能文档

支持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
数据来源:ClawHub ↗ · 中文优化:龙虾技能库
OpenClaw 技能定制 / 插件定制 / 私有工作流定制

免费技能或插件可能存在安全风险,如需更匹配、更安全的方案,建议联系付费定制

了解定制服务