Skip to content

About

๐Ÿ–ผ๏ธ AI Agent Skill โ€” batch convert JPG/PNG images to WebP format with a single command. Works with Hermes Agent.

Resources

Security policy

Stars

1 star

Watchers

0 watching

Forks

Latest commit

ย 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

image2webp-skill

๐Ÿ–ผ๏ธ AI Agent Skill โ€” batch convert JPG/PNG images to WebP format instantly, with a single conversation command.

Works with Hermes Agent, or any automation script running on macOS/Linux.

Skill Platform: macOS/Linux License: MIT GitHub Release


ไธญๆ–‡็‰ˆ

What is this?

image2webp-skill is an AI Agent Skill that converts images to WebP format. Tell your agent "convert these images to WebP" and it handles the rest โ€” single file or entire directory, recursive, with compression stats.

It wraps Google's cwebp encoder into a simple, agent-friendly interface. No GUI, no drag-and-drop, no manual clicking through Pixelmator. Just point it at a path and walk away.

The Problem It Solves

Converting images to WebP manually is tedious:

  • Open Pixelmator (or another editor)
  • File โ†’ Export โ†’ WebP
  • Adjust quality slider
  • Save
  • Repeat for every. single. image.

When you have 20 screenshots, this is soul-crushing. image2webp-skill makes it a one-line conversation:

"Convert ~/Downloads/ to WebP"

Done. All JPG/PNG files recursively converted. You get a summary with before/after sizes.

Architecture

You (via AI Agent)
    โ”‚  "Convert this folder to WebP"
    โ–ผ
Skill: image2webp-skill
    โ”‚  scripts/convert.sh <path> [quality]
    โ–ผ
cwebp (Google WebP encoder, via Homebrew)
    โ”‚  Reads JPEG/PNG/TIFF
    โ”‚  Encodes to WebP
    โ–ผ
.webp files written to same directory

No network. No external services. Just a bash script โ†’ cwebp โ†’ done.

Quick Start

Prerequisites

brew install webp

That's it. cwebp is part of Google's webp package.

Install the Skill

# Clone into your Hermes skills directory
cd ~/.hermes/skills/custom/
git clone https://github.com/colin-chang/image2webp-skill.git image2webp-skill

Usage (via AI Agent)

User: Convert ~/Desktop/screenshot.png to WebP
User: Convert ~/Downloads/blog-images/ to WebP, quality 90
User: Batch convert all images in ~/Pictures/ to WebP

The agent loads the skill, runs scripts/convert.sh, and reports back:

๐Ÿ“ ๆ‰ซๆ: /Users/colin/Downloads

  โœ“ photo1.jpg โ†’ photo1.webp  (1.2MB โ†’ 145KB, -88%)
  โœ“ photo2.png โ†’ photo2.webp  (3.4MB โ†’ 480KB, -86%)
  โœ“ photo3.jpg โ†’ photo3.webp  (856KB โ†’ 98KB, -89%)

๐Ÿ“Š ๅฎŒๆˆ: 3/3 ๆˆๅŠŸ

CLI Usage (without an agent)

# Single file
./scripts/convert.sh ~/Desktop/photo.png

# Entire directory (recursive)
./scripts/convert.sh ~/Downloads/ 80

# With custom quality
./scripts/convert.sh ~/Pictures/ 90

Features

Feature Description
๐ŸŽฏ Single file Convert one image: convert.sh photo.jpg
๐Ÿ“ Directory batch Recursively convert all images in a folder
๐Ÿงต Multi-threaded -mt flag enables parallel encoding
๐Ÿ“Š Compression stats Shows before/after size and reduction %
๐Ÿ”’ Non-destructive Original files are never deleted
๐ŸŒ Offline Zero network calls โ€” everything runs locally
๐ŸŽ›๏ธ Configurable quality -q 0-100 (default: 80)

Supported Formats

Input Output Notes
JPEG (.jpg, .jpeg) .webp โœ… Full support
PNG (.png) .webp โœ… Full support, alpha preserved
TIFF (.tiff, .tif) .webp โœ… Supported by cwebp
GIF, SVG, BMP, HEIC โ€” โŒ Not supported by cwebp encoder

Default Parameters

Parameter Value Description
Quality (-q) 80 0-100, higher = better quality, larger file
Compression method (-m) 6 0 (fast) to 6 (slowest, smallest file)
Multi-threading (-mt) On Use all CPU cores
Output mode (-quiet) On Only show summary, not per-file encoder output

Documentation

Document Description
SKILL.md Full skill reference (triggers, workflow, output format)
SECURITY.md Security considerations and attack surface
PRIVACY.md Data handling and privacy guarantees

Platform Support

  • macOS โ€” tested on macOS 15 (Sequoia)
  • Linux โ€” should work (requires cwebp from package manager)
  • cwebp installed via:
    • macOS: brew install webp
    • Ubuntu/Debian: apt install webp
    • Fedora: dnf install libwebp-tools

Agent Compatibility

This Skill is agent-agnostic โ€” it's a shell script. Any agent platform that can execute shell commands can use it:

Agent / Platform Integration
Hermes Agent Native Skill โ€” place in ~/.hermes/skills/custom/
Claude Code Add to CLAUDE.md, invoke via terminal
OpenCode / Codex Add to project instructions, invoke via shell
Any shell script ./scripts/convert.sh /path/to/images

License

MIT โ€” see LICENSE

FAQ

Q: Does this delete my original images? A: No. Original files are never modified or deleted. .webp files are created alongside the originals.

Q: Can I adjust the compression quality? A: Yes. Pass a second argument: ./scripts/convert.sh ~/Photos/ 90 (0-100, default 80).

Q: Does it handle subdirectories? A: Yes. Directory mode recursively scans all subdirectories.

Q: What if a .webp file already exists? A: It will be overwritten. The script doesn't skip existing files.

Q: Can I convert GIFs or SVGs? A: No. cwebp only supports JPEG, PNG, TIFF, and WebP as input formats.

About

๐Ÿ–ผ๏ธ AI Agent Skill โ€” batch convert JPG/PNG images to WebP format with a single command. Works with Hermes Agent.

Resources

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages