← Back to Skills Marketplace
ziji1224054593

Image Compressor

by ziji1224054593 · GitHub ↗ · v3.0.30 · MIT-0
cross-platform ⚠ suspicious
150
Downloads
0
Stars
1
Active Installs
5
Versions
Install in OpenClaw
/install image-compressor
Description
基于 `rv-image-optimize` 的图片压缩、上传与一体化压缩后上传 skill,支持 JPEG/PNG/WebP/AVIF、批量目录处理、FormData 接口配置与 JSON 结果汇总。Use when the user asks to compress images, upload optimi...
README (SKILL.md)

\r \r

Image Compressor\r

\r 基于 rv-image-optimize 的图片压缩、上传与格式转换 skill。 \r An image compression, upload, and format-conversion skill powered by rv-image-optimize.\r \r

核心功能 / Features\r

\r

  • 压缩单张或批量图片 / Compress single images or whole folders\r
  • 转换 jpegpngwebpavif / Convert between jpeg, png, webp, and avif\r
  • 压缩时限制尺寸 / Resize while compressing with max width and height\r
  • 通过 upload 子命令按 FormData 配置上传文件 / Upload files through the upload subcommand with FormData config\r
  • 通过 pipeline 子命令一条命令完成“压缩 + 上传” / Complete "compress + upload" in one command with the pipeline subcommand\r
  • 通过 chunkUpload 配置执行分片上传 / 断点续传 / Run chunked and resumable uploads through chunkUpload config\r
  • 输出结构化 JSON 结果 / Return structured JSON summaries for agents\r
  • 默认安全输出到新目录 / Default to safe output in a new directory\r \r

何时使用 / When to use\r

\r 当用户提到以下需求时使用:\r \r

  • “压缩图片”\r
  • “图片太大”\r
  • “减小文件大小”\r
  • “转成 WebP / AVIF”\r
  • “批量处理整个图片目录”\r
  • “压缩时顺便缩小尺寸”\r
  • “让 Agent / CLI 自动处理图片”\r
  • “压缩后上传到接口”\r
  • “按接口配置上传文件”\r
  • “大文件分片上传”\r
  • “断点续传”\r \r Use this skill when the user asks to:\r \r
  • compress one or more images\r
  • reduce image file size\r
  • convert images to webp or avif\r
  • batch-process an image folder\r
  • resize images while compressing\r
  • run image optimization from an agent or CLI workflow\r
  • upload files to an API through CLI\r
  • compress files and immediately upload them\r
  • perform chunked uploads for large files\r
  • resume interrupted uploads\r \r

默认策略 / Default behavior\r

\r 除非用户明确要求修改原图,否则优先使用安全模式:\r \r

  • 使用 --output-dir 输出到新目录\r
  • 使用 --json 方便 Agent 汇总结果\r
  • 默认不删除原图\r
  • 默认不替换原图\r
  • 大文件上传优先把 chunkUpload 写进 --config\r \r Preferred command:\r \r
rv-image-optimize "{input}" --output-dir "{outputDir}" --format webp --quality 82 --json\r
```\r
\r
如果全局命令不可用,可回退到:\r
\r
```bash\r
npx rv-image-optimize "{input}" --output-dir "{outputDir}" --format webp --quality 82 --json\r
```\r
\r
如果任务是“压缩后上传接口”,优先使用:\r
\r
```bash\r
rv-image-optimize pipeline "{input}" --format webp --quality 82 --config "{configPath}" --json\r
```\r
\r
如果任务是“已有文件直接上传接口”,优先使用:\r
\r
```bash\r
rv-image-optimize upload "{input}" --config "{configPath}" --json\r
```\r
\r
## 安全规则 / Safety rules\r
\r
以下选项只有在用户明确要求时才允许使用:\r
\r
- `--delete-original`\r
- `--replace-original`\r
\r
`--replace-original` 不能和以下参数一起使用:\r
\r
- `--output`\r
- `--output-dir`\r
- `--suffix`\r
\r
If the user wants to preserve source files, always choose `--output-dir`.\r
\r
上传相关安全约定:\r
\r
- 当前只保留 `FormData` 请求方式\r
- 复杂上传字段优先写进 `--config` JSON 文件\r
- 大文件 / 可恢复上传优先使用 `chunkUpload` 配置块\r
- `Authorization`、`Cookie`、`Content-Type` 优先用配置文件显式字段表达\r
- `Content-Type` 在 `FormData` 模式下通常建议留空,让运行时自动生成 boundary\r
\r
## 常用命令 / Common recipes\r
\r
### 单张图片压缩 / Compress a single image\r
\r
```bash\r
rv-image-optimize "./photo.jpg" --output-dir "./compressed" --format webp --quality 82 --json\r
```\r
\r
### 批量压缩目录 / Compress a folder\r
\r
```bash\r
rv-image-optimize "./images" --output-dir "./images-compressed" --format webp --quality 82 --json\r
```\r
\r
### 调整尺寸并压缩 / Resize and compress\r
\r
```bash\r
rv-image-optimize "./images" --output-dir "./images-compressed" --format webp --quality 82 --max-width 1920 --max-height 1080 --json\r
```\r
\r
### 压缩成功后删除原图 / Delete originals after success\r
\r
```bash\r
rv-image-optimize "./images" --output-dir "./images-compressed" --format webp --quality 82 --delete-original --json\r
```\r
\r
### 直接替换原图 / Replace originals in place\r
\r
```bash\r
rv-image-optimize "./images" --format webp --quality 82 --replace-original --json\r
```\r
\r
### 直接上传已有文件 / Upload existing files\r
\r
```bash\r
rv-image-optimize upload "./dist/demo.webp" --config "./upload.config.json" --json\r
```\r
\r
### 分片上传 / 断点续传 / Chunked resumable upload\r
\r
```bash\r
rv-image-optimize upload "./large-assets" --config "./upload.chunk.config.json" --timeout-ms 10000 --json\r
```\r
\r
### 压缩后直接上传 / Compress then upload\r
\r
```bash\r
rv-image-optimize pipeline "./images" --format webp --quality 82 --config "./upload.config.json" --json\r
```\r
\r
### 仅预览上传字段 / Preview upload fields only\r
\r
```bash\r
rv-image-optimize upload "./dist/demo.webp" --config "./upload.config.json" --preview-only --json\r
```\r
\r
## 汇报结果 / Reporting results\r
\r
使用 `--json` 时,建议汇总:\r
\r
- `total`\r
- `success`\r
- `failed`\r
- 输出目录或是否替换了原图\r
- 失败文件列表\r
- 上传模式下的 HTTP 状态码或预览字段\r
\r
## 推荐参数 / Recommended defaults\r
\r
- 默认格式:`webp`\r
- 默认质量:`82`\r
- 更小体积优先且接受更慢编码时:`avif`\r
- 上传任务默认优先使用 `--config`\r
- 大文件上传默认优先使用 `chunkUpload`\r
- 压缩后上传默认优先使用 `pipeline`\r
- 如需更多示例和参数说明,见 [reference.md](reference.md)\r
Usage Guidance
This skill appears to do what it says: compress and optionally upload images using the rv-image-optimize CLI. Before installing or using it, verify you trust the rv-image-optimize npm package (inspect its repo and recent versions). Be careful when creating upload.config.json: do not put long-lived secrets (Authorization tokens, cookies) into configs you don't trust or that will be sent to unknown endpoints. Use the --preview-only option to inspect form fields before performing uploads, and prefer output-dir/default safe options rather than --replace-original or --delete-original unless the user explicitly consents. If you run the CLI via npx, remember npx will execute code from the registry — run in a controlled environment if you need stronger isolation.
Capability Analysis
Type: OpenClaw Skill Name: image-compressor Version: 3.0.30 The skill provides image optimization and uploading capabilities via the `rv-image-optimize` package, but it includes high-risk features such as file deletion (`--delete-original`) and the ability to upload files to arbitrary remote URLs. Specifically, `SKILL.md` and `reference.md` instruct the agent on how to handle sensitive session data like `Authorization` tokens and `Cookie` headers during the upload process. While these capabilities are aligned with the stated purpose of the tool, they provide a direct mechanism for data exfiltration and unauthorized file modification if the agent is targeted by prompt injection.
Capability Assessment
Purpose & Capability
Name/description match the declared requirements and install: the skill requires the rv-image-optimize CLI (or npx) and installs the rv-image-optimize npm package. Those are exactly what an image-compression + upload wrapper would need.
Instruction Scope
SKILL.md only instructs running the CLI (or via npx) and writing/using upload config files; it does not ask the agent to read arbitrary system files or hidden credentials. Note: upload instructions explicitly allow Authorization/Cookie fields in the config, meaning user-supplied secrets in those config files will be transmitted to the configured endpoints — this is expected for an upload feature but is a potential data-exfiltration vector if misused.
Install Mechanism
Install uses the npm package rv-image-optimize (standard node install). This is an expected, traceable registry install and not a direct download from an arbitrary URL or a code-extract step.
Credentials
The skill declares no required environment variables or credentials. While the docs show fields for Authorization/Cookie in upload config files, those are user-supplied for legitimate upload workflows and are not requested automatically by the skill.
Persistence & Privilege
always is false, the skill is user-invocable and does not request persistent system-wide privileges or modify other skills' configurations. Autonomous invocation is allowed by default but not escalated here.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install image-compressor
  3. After installation, invoke the skill by name or use /image-compressor
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v3.0.30
- Added explicit support and instructions for chunked and resumable uploads using the chunkUpload config block. - Updated recommended usage scenarios and default strategies for large file uploads and interrupted upload resumption. - Expanded example commands to include chunked and resumable upload operations. - Enhanced safety and config guidance for FormData and chunked upload configurations.
v3.0.22
Summary: Adds image upload and "compress then upload" capabilities. - Added support for uploading files using the upload subcommand with FormData config. - Introduced pipeline subcommand for streamlined "compress + upload" in one command. - Updated skill description and usage guidance to include upload workflows. - Expanded common command recipes and safety rules for upload scenarios.
v3.0.2
## 插件亮点 / Highlights - 🚀 跨框架可用:同一个包同时覆盖 React 组件、Vue / Webpack / 原生 JS 工具函数,以及 Node / CLI 场景。 / Cross-framework support: one package covers React components, Vue / Webpack / vanilla JS utilities, and Node / CLI workflows. - 🌐 跨语言调用友好:Java / Python / PHP 等后端可直接通过 CLI 复用压缩能力。 / Friendly for multi-language backends: Java / Python / PHP and other services can reuse the compression pipeline through the CLI. - 🖼️ 图片优化能力完整:支持多 CDN 参数适配、自动格式选择、响应式图片、懒加载和渐进式加载。 / Complete image optimization features: multi-CDN URL adaptation, automatic format selection, responsive images, lazy loading, and progressive loading. - ⚙️ 浏览器与服务端双压缩链路:既支持浏览器端压缩 / 无损压缩,也支持 `node-compress` 在 Node 环境原生处理图片。 / Dual compression paths for browser and server: supports browser-side compression / lossless compression and native Node processing through `node-compress`. - 📦 支持静态图片打包压缩:可通过 `rv-image-optimize/vite-plugin` 在 `build` 后自动优化 `dist` 内静态图片。 / Static asset build optimization: use `rv-image-optimize/vite-plugin` to optimize static images in `dist` after build. - 📤 上传链路可复用:提供 `upload-core` 和 `upload` 两层入口。 / Reusable upload pipeline: ships both `upload-core` and `upload` entry points. - 💾 缓存体系完善:内置 IndexedDB + Worker 缓存能力,支持多库多表、自动过期和配额检测。 / Solid caching system: built-in IndexedDB + Worker caching with multi-database, multi-table, expiration, and quota checks. - 🧩 `JS / TS` 都可直接接入:从 `3.x` 开始提供官方 `.d.ts`。 / Ready for both `JS / TS`: official `.d.ts` files are included starting from `3.x`. - 🤖 Agent 集成友好:可直接接入 `Cursor`、`Claude Code`、skills 型 Agent,推荐通过 CLI + `--json` 调用。 / Agent-friendly integration: works well with `Cursor`, `Claude Code`, and skill-based agents, especially through the CLI with `--json`. ## Agent 集成亮点 / Agent Integration - 支持 `Cursor`、`Claude Code`、skills 型 Agent 直接接入。 / Supports direct integration with `Cursor`, `Claude Code`, and skill-based agents. - 推荐统一通过 `rv-image-optimize` CLI 调用,避免 Agent 临时拼接脚本。 / Using the `rv-image-optimize` CLI is recommended so agents do not have to assemble ad hoc scripts. - 支持 `--json` 结构化输出,方便 Agent 稳定解析成功数、失败数、输出目录和压缩结果。 / Supports structured `--json` output so agents can reliably parse success counts, failures, output paths, and compression results. - 既适合安全输出到新目录,也支持在用户明确授权时删除原图或替换原图。 / Works for safe output into a new directory and can also delete or replace originals when explicitly authorized. - 详细接入方式、推荐提示词和 skill 规则见 [AGENT_INTEGRATION.md](./AGENT_INTEGRATION.md)。 / See [AGENT_INTEGRATION.md](./AGENT_INTEGRATION.md) for detailed integration guidance, prompt suggestions, and skill rules.
v1.0.1
No changes detected in this version. - Version remains at 1.0.0 with no updates or modifications.
v1.0.0
- Initial release of the image-compressor skill. - Supports compression and format conversion for JPEG, PNG, WebP, AVIF, and GIF images. - Enables batch processing, adjustable compression quality, and dimension resizing. - Provides CLI commands and Node.js API for integration. - Includes React components for lazy and progressive image loading. - Offers recommended quality settings for different use cases.
Metadata
Slug image-compressor
Version 3.0.30
License MIT-0
All-time Installs 1
Active Installs 1
Total Versions 5
Frequently Asked Questions

What is Image Compressor?

基于 `rv-image-optimize` 的图片压缩、上传与一体化压缩后上传 skill,支持 JPEG/PNG/WebP/AVIF、批量目录处理、FormData 接口配置与 JSON 结果汇总。Use when the user asks to compress images, upload optimi... It is an AI Agent Skill for Claude Code / OpenClaw, with 150 downloads so far.

How do I install Image Compressor?

Run "/install image-compressor" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Image Compressor free?

Yes, Image Compressor is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Image Compressor support?

Image Compressor is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Image Compressor?

It is built and maintained by ziji1224054593 (@ziji1224054593); the current version is v3.0.30.

💬 Comments