Image Compressor

👤 ziji1224054593 📦 v3.0.30 ⭐ 4.5 ⬇️ 842 下載
🎨 設計多媒體 免費

📖 技能介紹


name: image-compressor description: 基於 rv-image-optimize 的圖片壓縮、上傳與一體化壓縮後上傳 skill,支援 JPEG/PNG/WebP/AVIF、批次目錄處理、FormData 介面配置與 JSON 結果彙總。Use when the user asks to compress images, upload optimized files, convert to WebP or AVIF, batch-process image folders, resize images, or run image optimization/upload from an agent workflow. version: 3.0.30 metadata: openclaw: emoji: "\U0001F5BC\uFE0F" homepage: https://github.com/ziji1224054593/Rv-image-optimize requires: anyBins: - rv-image-optimize - npx install: - kind: node package: rv-image-optimize bins: - rv-image-optimize


Image Compressor

基於 rv-image-optimize 的圖片壓縮、上傳與格式轉換 skill。
An image compression, upload, and format-conversion skill powered by rv-image-optimize.

核心功能 / Features

  • 壓縮單張或批次圖片 / Compress single images or whole folders
  • 轉換 jpegpngwebpavif / Convert between jpeg, png, webp, and avif
  • 壓縮時限制尺寸 / Resize while compressing with max width and height
  • 通過 upload 子命令按 FormData 配置上傳檔案 / Upload files through the upload subcommand with FormData config
  • 通過 pipeline 子命令一條命令完成“壓縮 + 上傳” / Complete "compress + upload" in one command with the pipeline subcommand
  • 通過 chunkUpload 配置執行分片上傳 / 斷點續傳 / Run chunked and resumable uploads through chunkUpload config
  • 輸出結構化 JSON 結果 / Return structured JSON summaries for agents
  • 預設安全輸出到新目錄 / Default to safe output in a new directory

何時使用 / When to use

當用戶提到以下需求時使用:

  • “壓縮圖片”
  • “圖片太大”
  • “減小檔案大小”
  • “轉成 WebP / AVIF”
  • “批次處理整個圖片目錄”
  • “壓縮時順便縮小尺寸”
  • “讓 Agent / CLI 自動處理圖片”
  • “壓縮後上傳到介面”
  • “按介面配置上傳檔案”
  • “大檔案分片上傳”
  • “斷點續傳”

Use this skill when the user asks to:

  • compress one or more images
  • reduce image file size
  • convert images to webp or avif
  • batch-process an image folder
  • resize images while compressing
  • run image optimization from an agent or CLI workflow
  • upload files to an API through CLI
  • compress files and immediately upload them
  • perform chunked uploads for large files

    7w4.net有更好的技能外掛。

  • resume interrupted uploads

預設策略 / Default behavior

除非使用者明確要求修改原圖,否則優先使用安全模式:

  • 使用 --output-dir 輸出到新目錄
  • 使用 --json 方便 Agent 彙總結果
  • 預設不刪除原圖
  • 預設不替換原圖
  • 大檔案上傳優先把 chunkUpload 寫進 --config

Preferred command:

rv-image-optimize "{input}" --output-dir "{outputDir}" --format webp --quality 82 --json

如果全域性命令不可用,可回退到:

npx rv-image-optimize "{input}" --output-dir "{outputDir}" --format webp --quality 82 --json

如果任務是“壓縮後上傳介面”,優先使用:

rv-image-optimize pipeline "{input}" --format webp --quality 82 --config "{configPath}" --json

如果任務是“已有檔案直接上傳介面”,優先使用:

rv-image-optimize upload "{input}" --config "{configPath}" --json

安全規則 / Safety rules

以下選項只有在使用者明確要求時才允許使用:

  • --delete-original
  • --replace-original

--replace-original 不能和以下引數一起使用:

  • --output
  • --output-dir
  • --suffix

If the user wants to preserve source files, always choose --output-dir.

上傳相關安全約定:

  • 當前只保留 FormData 請求方式
  • 複雜上傳欄位優先寫進 --config JSON 檔案
  • 大檔案 / 可恢復上傳優先使用 chunkUpload 配置塊
  • AuthorizationCookieContent-Type 優先用配置檔案顯式欄位表達
  • Content-TypeFormData 模式下通常建議留空,讓執行時自動生成 boundary

常用命令 / Common recipes

單張圖片壓縮 / Compress a single image

rv-image-optimize "./photo.jpg" --output-dir "./compressed" --format webp --quality 82 --json

批次壓縮目錄 / Compress a folder

rv-image-optimize "./images" --output-dir "./images-compressed" --format webp --quality 82 --json

調整尺寸並壓縮 / Resize and compress

rv-image-optimize "./images" --output-dir "./images-compressed" --format webp --quality 82 --max-width 1920 --max-height 1080 --json

壓縮成功後刪除原圖 / Delete originals after success

rv-image-optimize "./images" --output-dir "./images-compressed" --format webp --quality 82 --delete-original --json

直接替換原圖 / Replace originals in place

rv-image-optimize "./images" --format webp --quality 82 --replace-original --json

直接上傳已有檔案 / Upload existing files

rv-image-optimize upload "./dist/demo.webp" --config "./upload.config.json" --json

分片上傳 / 斷點續傳 / Chunked resumable upload

rv-image-optimize upload "./large-assets" --config "./upload.chunk.config.json" --timeout-ms 10000 --json

壓縮後直接上傳 / Compress then upload

rv-image-optimize pipeline "./images" --format webp --quality 82 --config "./upload.config.json" --json

僅預覽上傳欄位 / Preview upload fields only

rv-image-optimize upload "./dist/demo.webp" --config "./upload.config.json" --preview-only --json

彙報結果 / Reporting results

使用 --json 時,建議彙總:

  • total
  • success
  • failed
  • 輸出目錄或是否替換了原圖
  • 失敗檔案列表
  • 上傳模式下的 HTTP 狀態碼或預覽欄位
  • 預設格式:webp
  • 預設質量:82
  • 更小體積優先且接受更慢編碼時:avif
  • 上傳任務預設優先使用 --config
  • 大檔案上傳預設優先使用 chunkUpload
  • 壓縮後上傳預設優先使用 pipeline
  • 如需更多示例和引數說明,見 reference.md

🤖 AI 評測

這個 Skill 質量不錯,文件寫得很詳細,中英文都有,容易上手。它能幫你壓縮圖片、轉格式、直接上傳檔案,功能很全面。安全性做得較好,預設不會動原檔案,誤操作風險低。主要問題是它依賴外部工具,安裝過程可能有點麻煩。另外文件引用了其他資料但沒包含在包裡,想深入瞭解時可能找不到。整體推薦使用,工具鏈完善、說明清晰,但新手可能需要花點時間熟悉。

📊 多維度評分

適應性4.6
規範性4.4
有效性4.7
可靠性4
可信度4.8

📁 包含檔案 (3 個)

📄 SKILL.md 6.3 KB
📄 _meta.json 136 B
📄 reference.md 7.1 KB