| name | image |
| description | Compress and resize large images for Claude Code context. Use when encountering "image too large" errors or when user wants to process/compress images before analysis. |
Image Compression Skill
This skill helps you work with large images by compressing and resizing them to fit within Claude's context limits.
Capabilities
- Compress images to reduce file size
- Resize images while maintaining aspect ratio
- Convert images to optimized formats
- Handle multiple image formats (PNG, JPG, WEBP, GIF, BMP, TIFF)
- Automatic quality adjustment to meet size targets
- Batch process multiple images
When to Use
Use this skill when:
- Encountering "image too large" errors
- User wants to analyze a large image
- User wants to compress images before uploading
- Image file size exceeds recommended limits (typically >5MB)
How It Works
This skill uses Python with the Pillow library to:
- Open and analyze image files
- Resize images to reasonable dimensions
- Compress with quality optimization
- Output optimized images for Claude analysis
Default Limits
- Maximum dimension: 2048 pixels (width or height)
- Target file size: 1MB (adjustable)
- Default quality: 85 (JPEG/WEBP)
Usage Examples
python image_compressor.py photo.png
python image_compressor.py photo.png --max-size 1024
python image_compressor.py photo.png --target-kb 500
python image_compressor.py photo.png --format webp
python image_compressor.py photo.png --quality 75
python image_compressor.py ./images/ --batch
python image_compressor.py photo.png --info
Output
Compressed images are saved with _compressed suffix by default:
photo.png → photo_compressed.jpg
Use --output to specify custom output path:
python image_compressor.py photo.png --output optimized.jpg
Handling Large Images Workflow
For images that are too large:
- First run with
--info to see image details
- Compress with appropriate settings
- Use the compressed image for Claude analysis
Setup
Make sure you have Python and Pillow installed:
pip install Pillow