Metadata-Version: 2.4
Name: peasy-image
Version: 0.1.0
Summary: Python image toolkit — resize, crop, rotate, convert, compress, blur, sharpen, watermark, and 12 more operations. Powered by Pillow.
Project-URL: Homepage, https://peasyimage.com
Project-URL: Resize Image, https://peasyimage.com/tools/resize-image/
Project-URL: Compress Image, https://peasyimage.com/tools/compress-image/
Project-URL: Convert Image, https://peasyimage.com/tools/convert-image/
Project-URL: Documentation, https://peasyimage.com/developers/
Project-URL: Repository, https://github.com/peasytools/peasy-image
Project-URL: Issues, https://github.com/peasytools/peasy-image/issues
Project-URL: Changelog, https://github.com/peasytools/peasy-image/releases
Author: Peasy Tools
License-Expression: MIT
Keywords: blur,compress-image,convert-image,crop-image,exif,image,image-manipulation,image-toolkit,image-tools,pillow,resize-image,rotate-image,sharpen,thumbnail,watermark
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Multimedia :: Graphics
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: pillow>=10.0
Provides-Extra: all
Requires-Dist: httpx>=0.27; extra == 'all'
Requires-Dist: mcp>=1.0; extra == 'all'
Requires-Dist: rich>=13.0; extra == 'all'
Requires-Dist: typer>=0.15; extra == 'all'
Provides-Extra: api
Requires-Dist: httpx>=0.27; extra == 'api'
Provides-Extra: cli
Requires-Dist: rich>=13.0; extra == 'cli'
Requires-Dist: typer>=0.15; extra == 'cli'
Provides-Extra: mcp
Requires-Dist: mcp>=1.0; extra == 'mcp'
Description-Content-Type: text/markdown

# peasy-image

[![PyPI](https://img.shields.io/pypi/v/peasy-image)](https://pypi.org/project/peasy-image/)
[![Python](https://img.shields.io/pypi/pyversions/peasy-image)](https://pypi.org/project/peasy-image/)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)

Python image toolkit — resize, crop, rotate, compress, convert, blur, sharpen, watermark, and 12 more operations. Powered by Pillow.

Every function accepts `bytes | Path | str` and returns `bytes` — works with files, HTTP responses, and in-memory buffers.

> **Try the interactive tools at [peasyimage.com](https://peasyimage.com)**

## Install

```bash
pip install peasy-image          # Core (Pillow)
pip install "peasy-image[cli]"   # + CLI (typer, rich)
pip install "peasy-image[mcp]"   # + MCP server
pip install "peasy-image[all]"   # Everything
```

## Quick Start

```python
from peasy_image import resize, compress, info, convert

# Resize maintaining aspect ratio
resized = resize("photo.jpg", width=800)

# Compress to JPEG at quality 60
compressed = compress("photo.png", quality=60, fmt="jpeg")

# Convert to WebP
webp = convert("photo.jpg", fmt="webp")

# Get image info
meta = info("photo.jpg")
print(f"{meta.width}x{meta.height} {meta.format} ({meta.file_size / 1024:.0f} KB)")
```

## Operations

| Function | Description |
|----------|-------------|
| `resize` | Resize with aspect ratio preservation |
| `crop` | Crop to bounding box (left, top, right, bottom) |
| `rotate` | Rotate by angle with optional canvas expansion |
| `flip` | Flip horizontal, vertical, or both |
| `compress` | Reduce file size via quality adjustment |
| `convert` | Convert between PNG, JPEG, WebP, GIF, BMP, TIFF |
| `grayscale` | Convert to grayscale |
| `blur` | Gaussian blur |
| `sharpen` | Sharpen with adjustable factor |
| `brightness` | Adjust brightness |
| `contrast` | Adjust contrast |
| `invert` | Invert colors |
| `watermark` | Add text watermark at any anchor position |
| `thumbnail` | Center-crop square thumbnail |
| `strip_metadata` | Remove all EXIF/metadata |
| `info` | Get dimensions, format, mode, EXIF presence |
| `get_exif` | Extract EXIF metadata fields |
| `border` | Add solid color border |
| `round_corners` | Apply rounded corners with transparency |
| `pad` | Pad to target dimensions with centering |
| `overlay` | Overlay one image on another |

## CLI

```bash
peasy-image resize photo.jpg --width 800
peasy-image compress photo.png --quality 60
peasy-image convert photo.bmp webp
peasy-image info photo.jpg
peasy-image watermark photo.jpg "© 2026"
peasy-image thumbnail photo.jpg --size 128
```

## MCP Server

```json
{
  "mcpServers": {
    "peasy-image": {
      "command": "uvx",
      "args": ["--from", "peasy-image[mcp]", "python", "-m", "peasy_image"]
    }
  }
}
```

## License

MIT
