← 返回
内容创作

Baoyu Compress Image

Compresses images to WebP (default) or PNG with automatic tool selection. Use when user asks to "compress image", "optimize image", "convert to webp", or red...
将图像压缩为 WebP(默认)或 PNG,自动选择工具。适用于用户要求“压缩图像”“优化图像”“转换为 webp”“减小文件大小”等情形。
jimliu
内容创作 clawhub v1.117.2 4 版本 99743.8 Key: 无需
★ 0
Stars
📥 3,114
下载
💾 48
安装
4
版本
#latest

概述

Image Compressor

Compresses images using best available tool (sips → cwebp → ImageMagick → Sharp).

Script Directory

Scripts in scripts/ subdirectory. {baseDir} = this SKILL.md's directory path. Resolve ${BUN_X} runtime: if bun installed → bun; if npx available → npx -y bun; else suggest installing bun. Replace {baseDir} and ${BUN_X} with actual values.

ScriptPurpose
-----------------
scripts/main.tsImage compression CLI

Preferences (EXTEND.md)

Check EXTEND.md in priority order — the first one found wins:

PriorityPathScope
-----------------------
1.baoyu-skills/baoyu-compress-image/EXTEND.mdProject
2${XDG_CONFIG_HOME:-$HOME/.config}/baoyu-skills/baoyu-compress-image/EXTEND.mdXDG
3$HOME/.baoyu-skills/baoyu-compress-image/EXTEND.mdUser home

If none found, use defaults.

EXTEND.md supports: Default format, default quality, keep-original preference.

Usage

${BUN_X} {baseDir}/scripts/main.ts <input> [options]

Options

OptionShortDescriptionDefault
-------------------------------------
File or directoryRequired
--output-oOutput pathSame path, new ext
--format-fwebp, png, jpegwebp
--quality-qQuality 0-10080
--keep-kKeep originalfalse
--recursive-rProcess subdirsfalse
--jsonJSON outputfalse

Examples

# Single file → WebP (replaces original)
${BUN_X} {baseDir}/scripts/main.ts image.png

# Keep PNG format
${BUN_X} {baseDir}/scripts/main.ts image.png -f png --keep

# Directory recursive
${BUN_X} {baseDir}/scripts/main.ts ./images/ -r -q 75

# JSON output
${BUN_X} {baseDir}/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.

版本历史

共 4 个版本

  • v1.117.2 当前
    2026-05-19 10:24 安全 安全
  • v1.103.2
    2026-04-30 15:24 安全 安全
  • v1.0.0
    2026-03-30 14:25 安全 安全
  • v1.60.0
    2026-03-18 17:34

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

content-creation

AdMapix

fly0pants
广告情报与应用数据分析助手,支持搜索广告素材、分析应用排名、下载量、收入及市场洞察,用于广告素材和竞品分析。
★ 295 📥 136,445
data-analysis

Baoyu Infographic

jimliu
生成21种布局和22种视觉风格的专业信息图,分析内容,推荐布局×风格组合,并生成出版物。
★ 9 📥 9,258
content-creation

Baidu Wenku AIPPT

ide-rea
使用百度文库 AI 智能生成 PPT,自动根据内容选择模板。
★ 66 📥 46,156