peasy-image
Async Rust client for the PeasyImage API — compress, resize, convert, and crop images. Built with reqwest, serde, and tokio.
Built from PeasyImage, a comprehensive image processing toolkit offering free online tools for compressing, resizing, converting, and cropping images across all major formats. The site includes in-depth guides on image optimization for the web, format comparisons between WebP, AVIF, PNG, and JPEG, plus a glossary covering concepts from color spaces to alpha channels to EXIF metadata.
Try the interactive tools at peasyimage.com — Compress Image, Resize Image, Convert Image, Crop Image, and more.
Table of Contents
- Install
- Quick Start
- What You Can Do
- API Client
- Learn More About Image Tools
- Also Available
- Peasy Developer Tools
- License
Install
[]
= "0.2.0"
= { = "1", = ["full"] }
Or via cargo:
Quick Start
use Client;
async
What You Can Do
Image Processing Operations
Digital images are stored in dozens of formats, each optimized for different use cases. JPEG uses lossy compression ideal for photographs, PNG supports lossless compression with alpha channel transparency, WebP (developed by Google) offers both lossy and lossless modes at 25-34% smaller file sizes than JPEG, and AVIF (based on the AV1 video codec) pushes compression efficiency even further. PeasyImage provides tools to compress, resize, convert, and crop images across all these formats.
| Operation | Slug | Description |
|---|---|---|
| Compress Image | compress-image |
Reduce file size while preserving visual quality |
| Resize Image | resize-image |
Scale dimensions with aspect ratio preservation |
| Convert Image | convert-image |
Transform between PNG, JPEG, WebP, AVIF, and more |
| Crop Image | crop-image |
Extract rectangular regions from images |
use Client;
async
Learn more: Compress Image Tool · How to Compress Images for Web · Image Format Comparison
Browse Reference Content
PeasyImage includes a detailed glossary of image processing and digital media terminology, plus educational guides on format selection and optimization workflows. The glossary covers concepts like WebP (Google's modern image format with superior compression), EXIF (Exchangeable Image File Format metadata embedded by cameras), lossy vs. lossless compression trade-offs, color spaces (sRGB, Adobe RGB, Display P3), and alpha channels for transparency support.
| Term | Description |
|---|---|
| WebP | Google's modern image format — lossy and lossless modes |
| EXIF | Exchangeable Image File Format — camera metadata standard |
| Lossy Compression | Compression that discards data to achieve smaller files |
| Color Space | Mathematical model defining the range of representable colors |
| Alpha Channel | Transparency layer in PNG, WebP, and AVIF images |
use Client;
async
Learn more: Image Glossary · Image Format Comparison · How to Compress Images for Web
Search and Discovery
The API supports full-text search across all content types — tools, glossary terms, guides, use cases, and format documentation. Search results are grouped by content type, making it easy to find the right tool or reference for any image processing workflow.
use Client;
async
Learn more: REST API Docs · All Image Tools
API Client
The client wraps the PeasyImage REST API with strongly-typed Rust structs using serde deserialization.
use Client;
async
Available Methods
| Method | Description |
|---|---|
list_tools(&opts) |
List tools (paginated, filterable) |
get_tool(slug) |
Get tool by slug |
list_categories(&opts) |
List tool categories |
list_formats(&opts) |
List file formats |
get_format(slug) |
Get format by slug |
list_conversions(&opts) |
List format conversions |
list_glossary(&opts) |
List glossary terms |
get_glossary_term(slug) |
Get glossary term |
list_guides(&opts) |
List guides |
get_guide(slug) |
Get guide by slug |
list_use_cases(&opts) |
List use cases |
search(query, limit) |
Search across all content |
list_sites() |
List Peasy sites |
openapi_spec() |
Get OpenAPI specification |
Full API documentation at peasyimage.com/developers/. OpenAPI 3.1.0 spec: peasyimage.com/api/openapi.json.
Learn More About Image Tools
- Tools: Compress Image · Resize Image · Convert Image · Crop Image · All Tools
- Guides: Image Format Comparison · How to Compress Images for Web · All Guides
- Glossary: WebP · EXIF · Lossy Compression · Color Space · Alpha Channel · All Terms
- Formats: All Formats
- API: REST API Docs · OpenAPI Spec
Also Available
| Language | Package | Install |
|---|---|---|
| Python | peasy-image | pip install "peasy-image[all]" |
| TypeScript | peasy-image | npm install peasy-image |
| Go | peasy-image-go | go get github.com/peasytools/peasy-image-go |
| Ruby | peasy-image | gem install peasy-image |
Peasy Developer Tools
Part of the Peasy Tools open-source developer ecosystem.
| Package | PyPI | npm | crates.io | Description |
|---|---|---|---|---|
| peasy-pdf | PyPI | npm | crate | PDF merge, split, rotate, compress — peasypdf.com |
| peasy-image | PyPI | npm | crate | Image resize, crop, convert, compress — peasyimage.com |
| peasy-audio | PyPI | npm | crate | Audio trim, merge, convert, normalize — peasyaudio.com |
| peasy-video | PyPI | npm | crate | Video trim, resize, thumbnails, GIF — peasyvideo.com |
| peasy-css | PyPI | npm | crate | CSS minify, format, analyze — peasycss.com |
| peasy-compress | PyPI | npm | crate | ZIP, TAR, gzip compression — peasytools.com |
| peasy-document | PyPI | npm | crate | Markdown, HTML, CSV, JSON conversion — peasyformats.com |
| peasytext | PyPI | npm | crate | Text case conversion, slugify, word count — peasytext.com |
License
MIT