Single file or batch
Point aywebp at one image or a whole directory. Perfect for quick saves or bulk asset pipelines.
aywebp is a lightweight CLI that turns JPEG, PNG, GIF, TIFF, BMP, and WebP files into optimized .webp images — one file or entire folders, with sensible defaults and full control when you need it.
npm install -g aywebp
Built for developers who want smaller images without opening a GUI or writing a script from scratch.
Point aywebp at one image or a whole directory. Perfect for quick saves or bulk asset pipelines.
Use -r or --recursive to walk subdirectories and convert every supported image in one run.
Default quality is 85. Dial it from 1–100 with -q to balance size and visual fidelity.
Set -W / -H for width or height, or both with --fit. Aspect ratio is preserved by default.
Skips existing .webp files unless you pass --force. Originals stay unless you choose --delete-source.
Clear exit codes and a summary line make aywebp easy to plug into CI, npm scripts, and shell pipelines.
Uses sharp under the hood for native-speed encoding on every major platform.
Requires Node.js 18 or newer. npm is included with Node.
One command — available on the npm registry.
npm install -g aywebp
Open a terminal and check the CLI is on your PATH.
aywebp --version
Point aywebp at a file or folder.
aywebp photo.png aywebp ./images -r
Alternative: npm install -g github:kakajan/AyWebP
Output is always written beside the source: photo.jpg becomes photo.webp in the same folder.
aywebp photo.png aywebp ./images -r aywebp photo.png -W 1200 -H 800 aywebp ./assets -q 80 -f -d
aywebp-mcp exposes structured tools for AI agents — convert, inspect, and preview images with path sandboxing.
Works with any MCP-compatible IDE or CLI.
convert_images, inspect_image, list_convertible, get_version
Set AYWEBP_ALLOWED_ROOTS so agents only access folders you allow.
Ready-to-copy setup for Cursor, Claude Code, OpenCode, Codex, Windsurf, and Cline.
npm install -g aywebp # then add aywebp-mcp to your IDE — see examples/mcp-configs/
All inputs convert to .webp in the same directory.
If aywebp saves you time or disk space, a star helps other developers discover it. Issues and pull requests are welcome.