一键导入
image-compress-skill
A production-grade, Rust-powered image optimization engine for AI Agents. Smartly routes between PNG quantization and WebP compression.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
A production-grade, Rust-powered image optimization engine for AI Agents. Smartly routes between PNG quantization and WebP compression.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | image-compress-skill |
| description | A production-grade, Rust-powered image optimization engine for AI Agents. Smartly routes between PNG quantization and WebP compression. |
The intelligent image optimization engine for AI Agents. Smart routing between PNG quantization and WebP compression.
The optimal compression strategy depends on the input content type and the target use case.
| Content Type | Primary Strategy | Toolchain | Target Format |
|---|---|---|---|
| Photographs | Lossy WebP | image -> libwebp | .webp |
| Graphics / Logos / UI | Optimized PNG | image -> imagequant -> oxipng | .png |
| Universal (Web) | WebP (High Compat) | image -> libwebp | .webp |
| Universal (Archive) | Optimized PNG | image -> oxipng (Lossless) | .png |
Decision Logic:
oxipng (PNG) or Lossless WebP.This skill requires the image-compress-tool binary.
If the tool is not found, the agent should run:
./scripts/install.sh
Best for: Photos, complex gradients, web assets.
-q):
-m):
// Rust (using webp crate)
let encoder = webp::Encoder::from_image(&img)?;
let memory = encoder.encode(80.0); // Q=80
imagequant + oxipng)Best for: Logos, icons, screenshots, line art, transparent assets.
imagequant)
min=0, max=80 (or 80-90 for high fidelity).4 (Default). 1 (Slowest/Best).oxipng)
-o):
--strip safe): Remove metadata.-i 0): Disable interlacing (saves ~20%).// Pipeline
let (palette, pixels) = imagequant_attributes.quantize(img)?; // Step 1
let png_data = encode_png(palette, pixels);
let optimized = oxipng::optimize_from_memory(&png_data, &options)?; // Step 2
When implementing image compression tools:
[dependencies]
image = "0.25"
imagequant = "4.4"
oxipng = "10.1"
webp = "0.3"
anyhow = "1.0"
clap = { version = "4.5", features = ["derive"] }
See image-compress-tool/src/main.rs in the current project for the reference implementation that handles:
webp crate)imagequant -> png encoding -> oxipng)Always verify: