tuzi-compress-image
Image Compressor
Compresses images using best available tool (sips → cwebp → ImageMagick → Sharp).
Script Directory
Scripts in scripts/ subdirectory. Replace ${SKILL_DIR} with this SKILL.md's directory path.
| Script | Purpose |
|---|---|
scripts/main.ts |
Image compression CLI |
Preferences (EXTEND.md)
Use Bash to check EXTEND.md existence (priority order):
# Check project-level first
test -f .tuzi-skills/tuzi-compress-image/EXTEND.md && echo "project"
# Then user-level (cross-platform: $HOME works on macOS/Linux/WSL)
test -f "$HOME/.tuzi-skills/tuzi-compress-image/EXTEND.md" && echo "user"
┌────────────────────────────────────────────────────────┬───────────────────┐ │ Path │ Location │ ├────────────────────────────────────────────────────────┼───────────────────┤ │ .tuzi-skills/tuzi-compress-image/EXTEND.md │ Project directory │ ├────────────────────────────────────────────────────────┼───────────────────┤ │ $HOME/.tuzi-skills/tuzi-compress-image/EXTEND.md │ User home │ └────────────────────────────────────────────────────────┴───────────────────┘
┌───────────┬───────────────────────────────────────────────────────────────────────────┐ │ Result │ Action │ ├───────────┼───────────────────────────────────────────────────────────────────────────┤ │ Found │ Read, parse, apply settings │ ├───────────┼───────────────────────────────────────────────────────────────────────────┤ │ Not found │ Use defaults │ └───────────┴───────────────────────────────────────────────────────────────────────────┘
EXTEND.md Supports: Default format | Default quality | Keep original preference
Usage
npx -y bun ${SKILL_DIR}/scripts/main.ts <input> [options]
Options
| Option | Short | Description | Default |
|---|---|---|---|
<input> |
File or directory | Required | |
--output |
-o |
Output path | Same path, new ext |
--format |
-f |
webp, png, jpeg | webp |
--quality |
-q |
Quality 0-100 | 80 |
--keep |
-k |
Keep original | false |
--recursive |
-r |
Process subdirs | false |
--json |
JSON output | false |
Examples
# Single file → WebP (replaces original)
npx -y bun ${SKILL_DIR}/scripts/main.ts image.png
# Keep PNG format
npx -y bun ${SKILL_DIR}/scripts/main.ts image.png -f png --keep
# Directory recursive
npx -y bun ${SKILL_DIR}/scripts/main.ts ./images/ -r -q 75
# JSON output
npx -y bun ${SKILL_DIR}/scripts/main.ts image.png --json
Output:
image.png → image.webp (245KB → 89KB, 64% reduction)
Extension Support
Custom configurations via EXTEND.md. See Preferences section for paths and supported options.
More from tuziapi/tuzi-skills
tuzi-short-video
为小红书、抖音、X/Twitter、视频号等平台生成短视频内容。分析用户输入,自动适配平台规格,生成视频脚本并调用视频生成后端。当用户要求"生成短视频"、"做一个视频"、"短视频"或为社交平台创建视频内容时使用。
161tuzi-image-gen
通过兔子API(nano-banana 模型)、Google、OpenAI、DashScope 和 Replicate 进行 AI 图片生成。支持文生图、参考图片、宽高比、模型选择,以及 OpenAI 兼容网关方言切换。当用户要求生成、创建或绘制图片时使用。
155tuzi-video-gen
通过兔子API进行AI视频生成。支持 Veo、Sora、Kling、Seedance 等模型,单视频和长视频(多段合成)模式。当用户要求生成视频、创建视频或需要视频生成后端时使用。
138tuzi-comic
知识漫画创作工具,支持多种画风和语调。创建原创教育漫画,包含详细分镜布局和顺序图片生成。当用户要求创建"知识漫画"、"教育漫画"、"传记漫画"、"教程漫画"时使用。
134tuzi-infographic
生成专业信息图,包含 21 种布局类型和 20 种视觉风格。分析内容,推荐布局×风格组合,生成可发布的信息图。当用户要求创建"信息图"、"可视化"、"高密度信息大图"、"visual summary"时使用。
134tuzi-post-to-wechat
通过 API 或 Chrome CDP 发布内容到微信公众号。支持文章发布(HTML、Markdown 或纯文本输入)和图文消息发布(多图)。当用户提到"发布公众号"、"微信公众号"、"贴图"、"图文"、"文章"时使用。
132