Index of every page on this site: llms.txt
All skills
jimliu avatar

/baoyu-compress-image

@bf1ff07 official
by Jim Liu 宝玉jimliu/baoyu-skills28k stars
3,011
Run it yourself

Compresses images to WebP (default) or PNG with automatic tool selection. Use when user asks to "compress image", "optimize image", "convert to webp", or reduce image file size.

Use this Skill: https://skilld.dev/gh/jimliu/baoyu-skills/baoyu-compress-image

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈50 tokens for metadata: the name and description. ≈450 when used: this file.

Description uses 2.5% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈200 characters, or 2.5%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

Image Compressor

Tool auto-selection order: sips → cwebp → ImageMagick → Sharp.

Script Directory

{baseDir} = this SKILL.md's directory. Resolve ${BUN_X}: bun if installed; else npx -y bun; else suggest installing bun. Replace {baseDir} and ${BUN_X} with actual values.

Script Purpose
scripts/main.ts Image compression CLI

Preferences (EXTEND.md)

First found wins:

Priority Path Scope
1 .baoyu-skills/baoyu-compress-image/EXTEND.md Project
2 ${XDG_CONFIG_HOME:-$HOME/.config}/baoyu-skills/baoyu-compress-image/EXTEND.md XDG
3 $HOME/.baoyu-skills/baoyu-compress-image/EXTEND.md User 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]
${BUN_X} {baseDir}/scripts/main.ts image.png                    # → WebP, replaces original
${BUN_X} {baseDir}/scripts/main.ts image.png -f png --keep      # keep PNG format and original
${BUN_X} {baseDir}/scripts/main.ts ./images/ -r -q 75           # directory, recursive

Output: image.png → image.webp (245KB → 89KB, 64% reduction)

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

Extension Support

Custom configurations via EXTEND.md. See Preferences section for paths and supported options.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts18d5 checks · Risk SAFE
  • Gen Agent Trust Hub18d

    The skill is an image compression utility that uses system tools like sips, cwebp, or ImageMagick. It follows security best practices for executing external commands and managing files.

  • Socket18d

    No alerts

  • Snyk18d

    Risk: LOW · No issues

  • Runlayer8mo

    1/2 files flagged

  • ZeroLeaks7mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at bf1ff07. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 3 weeks ago
version
1.56.1
Other metadata
metadata
{
  "openclaw": {
    "homepage": "https://github.com/JimLiu/baoyu-skills#baoyu-compress-image",
    "requires": {
      "anyBins": [
        "bun",
        "npx"
      ]
    }
  }
}

README badge

README badge for jimliu/baoyu-skills/baoyu-compress-image

Compresses images to WebP or PNG format by automatically selecting the best available tool (sips, cwebp, ImageMagick, or Sharp). Reduces file size with configurable quality settings and supports batch processing of directories.

Generated from the current SKILL.md.

What image formats does this skill support?
Input formats are unrestricted (PNG, JPEG, GIF, etc.). Output formats are WebP (default), PNG, or JPEG. The skill auto-selects the best available compression tool (sips, cwebp, ImageMagick, or Sharp).
Does this skill require bun to be installed?
Bun or npx must be available. If bun is installed, it runs directly; otherwise the skill falls back to npx -y bun.
Can I process multiple images at once?
Yes. Pass a directory path with the `--recursive` flag to compress all images in that directory and subdirectories.
Can I customize default quality or output format?
Yes. Create an EXTEND.md file in one of the config directories (.baoyu-skills, XDG_CONFIG_HOME, or home) to set default format, quality, and keep-original preference.
What happens to the original file?
By default, the original is replaced with the compressed version. Use the `--keep` flag to preserve both files.

Generated from the current SKILL.md. These answers refresh after source changes.