Token导航 LogoToken导航TokenDH.com
效率权限需确认clawhub未标认证来源可访问clear审计通过

file-compression文件压缩

Agent Skill

file-compression 用于处理图像、截图、视觉识别或图片素材相关工作,适合在 OpenClaw 中需要让 Agent 分析图片、整理视觉素材或辅助图像流程时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

14,328

周安装

597

GitHub Stars

2

下载量

4,776
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:file-compression(文件压缩)
来源仓库:https://github.com/hexavi8/file-compression
安装命令:
openclaw skills install file-compression
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install file-compression

简介

压缩文件以减少存储和传输大小的工具。

  • 优化 PDF 和图像的上传共享尺寸。
  • 平衡质量与压缩率参数可调。file-compression 属于效率类 Skill,可作为该场景下的辅助能力补充。
  • 安装命令:openclaw skills install file-compression。
  • 建议在需要减小文件体积时使用。

SKILL.md

name
file-compression
description
Compress files to reduce storage and transfer size. Use this skill when users ask to shrink PDFs or images, optimize upload/share size, or balance quality and size. Supports PDF compression and image compression with Python-first workflows plus Node.js fallback when Python dependencies are unavailable.
metadata

File Compression

Compress files with Python-first workflows and Node.js fallback workflows.

Supported File Types

  • PDF: .pdf
  • Image: .jpg, .jpeg, .png, .webp

What This Skill Can Do

  • Compress PDF with preset quality levels.
  • Compress image with quality/resize/format controls.
  • Switch backend automatically when dependencies are missing.
  • Detect bad compression results and retry with better strategy.

Installation Spec (Before Running)

Required binaries:

  • python3 (recommended >= 3.8)
  • node
  • gs (Ghostscript, required for PDF Ghostscript paths)

Python install spec:

python3 -m pip install -r {baseDir}/requirements.txt

Node install spec:

cd {baseDir}
npm install

Ghostscript install examples:

  • macOS: brew install ghostscript
  • Ubuntu/Debian: sudo apt-get update && sudo apt-get install -y ghostscript

Safety note:

  • Explain to the user before each install command that third-party packages are being installed.
  • If installation fails, report the failing command and switch to available fallback backend.

CLI Options Cheat Sheet

PDF (scripts/compress_pdf.py):

  • --preset screen|ebook|printer|prepress
  • --strategy auto|ghostscript|pikepdf
  • --remove-metadata
  • --no-linearize
  • --overwrite

PDF Node (scripts/compress_pdf_node.mjs):

  • --preset screen|ebook|printer|prepress

Image (scripts/compress_image.py):

  • --quality <1-100>
  • --format keep|jpeg|png|webp
  • --max-width <n>
  • --max-height <n>
  • --strategy auto|pillow|node
  • --overwrite

Image Node (scripts/compress_image_node.mjs):

  • --quality <1-100>
  • --format keep|jpeg|png|webp
  • --max-width <n>
  • --max-height <n>

Example Set (Python + Node)

PDF default:

python {baseDir}/scripts/compress_pdf.py in.pdf out.pdf

PDF aggressive:

python {baseDir}/scripts/compress_pdf.py in.pdf out.pdf --preset screen --strategy ghostscript

PDF with pikepdf:

python {baseDir}/scripts/compress_pdf.py in.pdf out.pdf --strategy pikepdf --remove-metadata

PDF via Node:

node {baseDir}/scripts/compress_pdf_node.mjs in.pdf out.pdf --preset ebook

Image default:

python {baseDir}/scripts/compress_image.py in.jpg out.jpg --quality 75

Image convert + resize:

python {baseDir}/scripts/compress_image.py in.png out.webp --format webp --quality 72 --max-width 1920

Image force Node backend:

python {baseDir}/scripts/compress_image.py in.jpg out.jpg --strategy node --quality 70

Image direct Node:

node {baseDir}/scripts/compress_image_node.mjs in.jpg out.jpg --quality 70 --max-width 1600

Environment and Fallback

Check and install in this order:

  1. Python: python3 --version (fallback: python --version)
  2. Node: node --version
  3. Ghostscript: gs --version (required for PDF Ghostscript paths)
  4. Python deps when needed:

- pip install pikepdf - pip install pillow

  1. Node deps when needed:

- npm install

Fallback policy:

  • PDF: ghostscript -> pikepdf -> node-ghostscript
  • Image: pillow -> node-sharp

If python3.8+ is unavailable, try python3.11/3.10/3.9/3.8; if still blocked, use Node flow when possible.

Execution Transparency

Always communicate each step:

  1. Tell user what you are checking or running.
  2. Show the exact command before execution.
  3. For slow steps (pip install, npm install, large Ghostscript jobs), say you are waiting.
  4. After each step, report result and next action.

Bad Result Recovery

When output_size >= input_size, do not stop:

  1. Report exact from/to numbers and compression ratio.
  2. Explain likely cause:

- PDF: already optimized, scanned-image content, metadata overhead, unsuitable preset. - Image: unsuitable format conversion, quality too high, small-file overhead.

  1. Retry with alternate strategy:

- PDF: ebook -> screen, then switch backend. - Image: lower quality, switch backend, convert to webp, optionally resize.

  1. Return the best attempt and state which command produced it.

Agent Response Contract

After every compression task, always return:

  1. Output absolute path.
  2. from <before_size> to <after_size>.
  3. saved <delta_size> (<ratio>%).
  4. Backend used.

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

96.95%
按下载量换算4,630

安全审计

VirusTotal

通过

ClawScan

通过

Static analysis

未展示

权限和风险

权限需确认

当前来源未能明确判断权限范围,默认进入异常复核队列。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills