← Back to Skills Marketplace
sunnyton

image-convert

by Shuguang Tang · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
34
Downloads
0
Stars
1
Active Installs
1
Versions
Install in OpenClaw
/install image-convert
Description
Convert and compress images or videos between formats including PNG, JPG, WebP, GIF, BMP, TIFF, HEIC, AVIF, and create GIFs from videos with adjustable quali...
README (SKILL.md)

Image Convert & Compress

Quick Commands

Format Conversion (ffmpeg)

ffmpeg -i input.png output.jpg # PNG → JPG
ffmpeg -i input.jpg output.png # JPG → PNG
ffmpeg -i input.png output.webp        # PNG → WebP
ffmpeg -i input.jpg output.webp        # JPG → WebP (lossy)
ffmpeg -i input.jpg output.webp -quality 90  # JPG → WebP 高质量

macOS Built-in (sips)

sips -s format jpeg input.png --out output.jpg    # PNG → JPG
sips -s format png input.jpg --out output.png # JPG → PNG
sips -s format jpeg -s formatOptions 80 input.png --out output.jpg  # 压缩 JPG

HEIC/HEIF 支持

ffmpeg -i input.heic output.jpg # HEIC → JPG
ffmpeg -i input.jpg output.heic        # JPG → HEIC (需要 x265)

ImageMagick (convert)

convert input.png -quality 80 output.jpg           # 压缩 JPG
convert input.png -resize 50% output.png # 缩小 50%
convert input.png -resize 800x output.jpg # 宽度 800px 等比
convert input.jpg -colors 256 output.png           # 减少颜色
convert input.png -strip output.png               # 去除元数据

GIF 制作

从视频(推荐高压缩):

ffmpeg -i input.mp4 -vf "fps=10,scale=320:-1:flags=lanczos,split[s0][s1];[s0]palettegen=stats_mode=full:max_colors=64[p];[s1][p]paletteuse=dither=bayer:bayer_scale=5" -loop 0 output.gif

从视频(高质量):

ffmpeg -i input.mp4 -vf "fps=15,scale=480:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0 output.gif

参数说明:

  • fps=N:帧率,越高质量越大
  • scale=W:-1:宽度,高度等比自动计算
  • max_colors=N:调色板颜色数(8-256),越小文件越小
  • loop0:无限循环;loop -1:不循环;loop N:循环 N 次

###图像压缩

JPG 压缩:

ffmpeg -i input.jpg -q:v 2 output.jpg    # q:v 1-31,越小质量越高
sips -s format jpeg -s formatOptions 70 input.jpg --out output.jpg

PNG 压缩(pngquant):

pngquant --quality=65-80 --force --output output.png input.png

PNG 优化(optipng):

optipng -o5 input.png                    # -o1 到 -o7压缩级别

WebP 压缩:

ffmpeg -i input.jpg -c:v libwebp -quality 75 output.webp

GIF 压缩工具

gifsicle(需安装):

gifsicle -O3 --colors128 --lossy 30 -o output.gif input.gif

ffmpeg 重新压缩:

ffmpeg -i input.gif -vf "split[s0][s1];[s0]palettegen=stats_mode=diff[p];[s1][p]paletteuse" -y output.gif

常用参数参考

格式 质量参数 特点
JPG -q:v 2-31 或 -s formatOptions 60-100 有损,文件小
PNG 无损 透明背景支持
WebP -quality 0-100 优于 JPG/PNG
GIF fps/colors 动图,支持透明
HEIC 有损 iPhone 默认格式
AVIF -quality 极小文件,极高压缩

常见问题

GIF 文件太大?

  1. 降低帧率:-fps=8
  2. 缩小尺寸:-scale=320:-1
  3. 减少颜色:-max_colors=64
  4. 使用 gifsicle 压缩

颜色失真? 使用调色板生成器 palettegen+paletteuse,比默认256 色更好

透明背景丢失? 确保输出格式支持透明(PNG、GIF、WebP),JPG 不支持透明

ffmpeg 报错 "Not found"? macOS 用 ffmpeg(Homebrew 安装的版本),非 Apple 预装版本

工具检查

which ffmpeg    # 检查 ffmpeg
which convert # 检查 ImageMagick
which optipng   # 检查 optipng
which pngquant # 检查 pngquant
Usage Guidance
Reasonable to install if you want help creating skills. As with any skill-writing assistant, review any generated skill files or optional scripts before using or publishing them, especially if you add credentials, network calls, or automation later.
Capability Assessment
Purpose & Capability
The stated purpose is to guide skill creation, and the reviewed artifact content matches that purpose with requirements gathering, drafting, structure guidance, and user review.
Instruction Scope
Instructions are scoped to user-directed creation of skill files and optional references or utilities; they do not ask the agent to bypass controls, hide behavior, collect unrelated data, or act without user input.
Install Mechanism
The target contains a single non-executable SKILL.md file and no install scripts, binaries, package dependencies, or automatic runtime hooks.
Credentials
Creating SKILL.md, reference files, or optional utility scripts is proportionate to the skill-writing purpose, and there is no broad local indexing, credential use, network access, or unrelated data flow.
Persistence & Privilege
The artifact does not request persistence, background execution, elevated privileges, credential/session access, or long-running workers.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install image-convert
  3. After installation, invoke the skill by name or use /image-convert
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
- Initial release of the image-convert skill. - Supports conversion and compression for PNG, JPG, WebP, GIF, BMP, TIFF, HEIC, AVIF formats. - Includes video-to-GIF conversion with recommended ffmpeg commands. - Provides quick command guides for ffmpeg, sips (macOS), ImageMagick, gifsicle, pngquant, and optipng. - Features common troubleshooting tips and tool verification steps. - Chinese trigger phrases supported for conversion and compression queries.
Metadata
Slug image-convert
Version 1.0.0
License MIT-0
All-time Installs 1
Active Installs 1
Total Versions 1
Frequently Asked Questions

What is image-convert?

Convert and compress images or videos between formats including PNG, JPG, WebP, GIF, BMP, TIFF, HEIC, AVIF, and create GIFs from videos with adjustable quali... It is an AI Agent Skill for Claude Code / OpenClaw, with 34 downloads so far.

How do I install image-convert?

Run "/install image-convert" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is image-convert free?

Yes, image-convert is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does image-convert support?

image-convert is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created image-convert?

It is built and maintained by Shuguang Tang (@sunnyton); the current version is v1.0.0.

💬 Comments