← Back to Skills Marketplace
ginntech

Img Compress

by Frank_Jin · GitHub ↗ · v1.0.1 · MIT-0
cross-platform ⚠ suspicious
116
Downloads
0
Stars
1
Active Installs
2
Versions
Install in OpenClaw
/install img-compress
Description
批量压缩图片文件大小,支持JPG/PNG,保持尺寸只压体积。当用户提到:压缩图片、减少图片大小、图片太大、图片优化、批量压缩图片时使用。
README (SKILL.md)

img-compress

Batch image compression tool based on Pillow(PIL).

Quick Usage

# Compress images over 100KB to 80KB
sudo python3 skills/img-compress/scripts/compress_img.py /path/to/images

# Custom target size (KB)
sudo python3 skills/img-compress/scripts/compress_img.py /path/to/images 150

Compression Rules

  • JPG/JPEG: Gradually reduce quality (85→50) + optimize until under target size
  • PNG: Pillow PNG compression (limited), recommend pngquant for better results
  • Files under target size are skipped
  • Overwrites original files (in-place)

Dependencies

  • Python3
  • Pillow: pip3 install Pillow

Typical Scenarios

# Compress website static assets
sudo python3 skills/img-compress/scripts/compress_img.py /var/www/static/img 100
Usage Guidance
Do not run this script as root or with sudo without checking what it will do. Inspect and (preferably) change the default path in the script — it currently points to /www/wwwroot/lovehibachi_demo/public/static/img, which could overwrite a website's images if you run it with no args. Test on a copy of images first, and back up originals; consider adding a dry-run or backup step. Avoid running the provided examples verbatim (they show sudo). If you proceed, run inside a controlled directory (not system webroots), use a Python virtualenv and install Pillow locally, and be aware PNGs may be converted to JPEG (losing transparency). If you want, I can suggest safe edits to add confirmations, backups, or a dry-run mode.
Capability Analysis
Type: OpenClaw Skill Name: img-compress Version: 1.0.1 The skill bundle is classified as suspicious because SKILL.md explicitly instructs the agent to execute the compression script using 'sudo', which grants unnecessary root privileges for image processing. While the script scripts/compress_img.py performs its stated function of image compression using Pillow, it lacks path sanitization and performs in-place file overwrites, which poses a risk to system integrity if the agent is directed to sensitive directories while running with elevated permissions.
Capability Assessment
Purpose & Capability
Name/description match the included script: a Pillow-based batch compressor for JPG/PNG. However the script defaults to a very specific path (/www/wwwroot/lovehibachi_demo/public/static/img) which is unrelated to a generic 'img-compress' purpose and suggests the package was tailored to one environment.
Instruction Scope
SKILL.md instructs running the script with sudo in examples; the script overwrites originals in-place and will scan any directory provided (or the hard-coded default). There are no safeguards (no dry-run, no backups, no confirmation) and PNG handling may convert some images to JPEG, losing alpha. These instructions widen scope beyond harmless compression and increase risk of destructive changes.
Install Mechanism
No install spec; this is an instruction-only skill plus a small Python script. Dependency is only Pillow (pip). No external downloads or obscure installers are used.
Credentials
The skill requests no credentials, environment variables, or config paths. It does not attempt network access or exfiltration. The only notable environment guidance is example use of sudo (over-privileged but not a credential request).
Persistence & Privilege
The skill does not request permanent presence or elevated platform privileges, but examples encourage using sudo and the default path targets a webroot that often requires elevated permissions. This combination increases the blast radius if run carelessly.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install img-compress
  3. After installation, invoke the skill by name or use /img-compress
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.1
英文描述更新
v1.0.0
批量图片压缩工具,支持JPG/PNG,保持尺寸只压体积
Metadata
Slug img-compress
Version 1.0.1
License MIT-0
All-time Installs 1
Active Installs 1
Total Versions 2
Frequently Asked Questions

What is Img Compress?

批量压缩图片文件大小,支持JPG/PNG,保持尺寸只压体积。当用户提到:压缩图片、减少图片大小、图片太大、图片优化、批量压缩图片时使用。 It is an AI Agent Skill for Claude Code / OpenClaw, with 116 downloads so far.

How do I install Img Compress?

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

Is Img Compress free?

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

Which platforms does Img Compress support?

Img Compress is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Img Compress?

It is built and maintained by Frank_Jin (@ginntech); the current version is v1.0.1.

💬 Comments