用途:当用户要求缩放图片、为网页压缩或优化图片、在 PNG/JPG/WebP/GIF/BMP/TIFF 之间转换、裁剪、查看图片信息(尺寸、格式、文件大小)、生成缩略图或旋转翻转图片时使用本技能。
主要能力与参数:action 为必填,取 resize、compress、convert、crop、info、rotate;input 为输入路径;多数操作需指定 output 输出路径。resize 用 width、height 指定像素尺寸;compress 用 quality(1-100,默认 80)控制 JPEG/WebP 质量;convert 用 format 指定目标格式;crop 用 crop_box,即 left,top,right,bottom 像素坐标;rotate 用 angle 指定角度。
使用方式:通过捆绑脚本 scripts/process.py 执行,例如缩放 python3 skills/image-tools/scripts/process.py resize input.jpg --width 800 --output resized.jpg;压缩 python3 skills/image-tools/scripts/process.py compress photo.jpg --quality 75 --output compressed.jpg;转换 python3 skills/image-tools/scripts/process.py convert image.png --format webp --output image.webp;裁剪 python3 skills/image-tools/scripts/process.py crop photo.jpg --box 0,0,500,400 --output cropped.jpg;查看信息 python3 skills/image-tools/scripts/process.py info photo.jpg;旋转 python3 skills/image-tools/scripts/process.py rotate photo.jpg --angle 90 --output rotated.jpg。脚本会在需要时自动安装 Pillow,执行后向用户报告结果。
适用场景:网页图片优化、格式互转、批量前置的单张处理、快速获取图片元数据、生成缩略图等。
限制:资料未提供批量处理、云端服务、价格或平台支持等更多信息,暂未提供;GIF 支持动画,TIFF 面向专业/打印用途。