image-compress

Compress, resize, and convert images between jpg, png, and webp formats locally.

1.7k|418|Updated Mar 9, 2026
One-click install
npx skills add https://github.com/dongsheng123132/u-claw --skill image-compress
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: image-compress
Source: https://github.com/dongsheng123132/u-claw/tree/main/portable/skills-cn/image-compress
Command: npx skills add https://github.com/dongsheng123132/u-claw --skill image-compress

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires Pillow.

What problem does it solve?

Large image files are hard to email, upload to chat apps, or store efficiently, and online compression tools require uploading private photos to third-party servers. This Skill compresses, resizes, and converts images entirely on the local machine so files never leave the device.

Core Features & Use Cases

  • Compression: Reduce file size by controlling quality and resolution, suitable for email attachments and messaging apps.
  • Resizing: Scale images by width, height, or percentage while preserving aspect ratio.
  • Format Conversion: Convert between jpg, png, and webp, with webp offering the smallest output size.
  • Batch Processing: Process an entire folder of images in one run.
  • Use Case: You have a folder of 50 phone photos totaling 300 MB that you need to send via WeChat. Batch-convert them to webp at quality 80, cutting the size dramatically while keeping the originals untouched.

Quick Start

Compress all jpg and png images in the current folder to webp format and show me the size reduction for each file.

Frequently Asked Questions about image-compress

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I compress images in Python without losing quality?

Use the Pillow library to save images with a quality parameter, such as quality=75 for JPEG, and resize large dimensions before saving. This reduces file size significantly while keeping visual quality acceptable for email and chat sharing.

How to batch convert jpg and png images to webp?

Loop over files with glob, open each with Pillow's Image.open, and save with the WEBP format at quality 80. Webp typically produces smaller files than jpg or png at comparable visual quality.

Does converting PNG to JPG lose transparency?

Yes, JPG does not support alpha channels, so transparent areas become a solid background when converting PNG to JPG. Convert to webp instead if you need to preserve transparency while reducing file size.

Can I compress images without uploading them to an online tool?

Yes, this Skill runs Pillow locally through Python, so images are processed entirely on your machine. No files are uploaded to external servers, which keeps private photos on your device.

What are the limitations of Pillow for image compression?

Pillow handles common formats like jpg, png, and webp but does not support specialized formats such as HEIC or RAW without extra plugins. It also requires manual quality tuning since it has no automatic target-file-size mode.