LighterImage - Image Compressor With No Quality Loss
Pricing
Pay per event
Go to Apify Store

LighterImage - Image Compressor With No Quality Loss
Compress images & convert to WebP in one API call. Input via URL, Base64, or KV store. Output: optimized original + WebP with compression stats. TinyPNG-quality algorithms (mozjpeg, palette mode, smart subsampling). Batch processing for automation pipelines. Pay only for successful compressions.
Pricing
Pay per event
Rating
0.0
(0)
Developer

Jake Reinders
Maintained by Community
Actor stats
0
Bookmarked
2
Total users
1
Monthly active users
7 days ago
Last modified
Categories
Share
Image Compression & WebP Optimization Actor
Compress images and convert to WebP format. Supports URL, Base64, and Key-Value store input.
Features
- Multiple input methods: URL, Base64 data, or Apify Key-Value store
- Dual output: Compressed original format (JPEG/PNG) + WebP version
- Batch processing: Up to 200 images per run (Pro tier)
- Optional resizing: Set max width/height constraints
- Configurable quality: Override default quality settings
- Tier-based limits: Free and Pro tiers with different limits
Input
{"images": [{ "url": "https://example.com/image.jpg" },{ "base64": "iVBORw0KGgo..." },{ "key": "my-image-key", "filename": "photo.png" }],"quality": 80,"returnWebp": true,"returnOriginalFormat": true,"maxWidth": 1920,"maxHeight": 1080,"tier": "free"}
Input Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
images | array | Yes | - | Array of images to compress |
images[].url | string | No* | - | Public URL of image |
images[].base64 | string | No* | - | Base64-encoded image data |
images[].key | string | No* | - | Key in default KV store |
images[].filename | string | No | - | Output filename |
quality | number | No | 80-85 | Quality (1-100) |
returnWebp | boolean | No | true | Generate WebP version |
returnOriginalFormat | boolean | No | true | Return compressed original |
maxWidth | number | No | - | Max width for resizing |
maxHeight | number | No | - | Max height for resizing |
tier | string | No | "free" | Usage tier: "free" or "pro" |
*At least one of url, base64, or key must be provided per image.
Output
{"results": [{"input": "https://example.com/image.jpg","originalCompressedUrl": "https://api.apify.com/v2/key-value-stores/.../records/image-compressed-123.jpg","webpUrl": "https://api.apify.com/v2/key-value-stores/.../records/image-webp-123.webp","stats": {"inputSize": 5423123,"compressedSize": 2143001,"webpSize": 537121,"compressionRatio": 0.40,"durationMs": 128}}],"successCount": 1,"errorCount": 0,"totalDurationMs": 250}
Tier Limits
| Tier | Images/Run | Max File Size |
|---|---|---|
| Free | 10 | 15 MB |
| Pro | 200 | 30 MB |
Supported Formats
Input: JPEG, PNG, WebP, BMP
Output:
- Original format (JPEG or PNG, optimized)
- WebP (always available)
Compression Settings
The Actor uses proven compression settings from LighterImage:
- JPEG: Quality 82, mozjpeg encoder, progressive, trellis quantization
- PNG: Quality 85, palette mode (256 colors), Floyd-Steinberg dithering
- WebP: Quality 80, smart subsampling, effort level 6
Usage Examples
Compress images from URLs
{"images": [{ "url": "https://example.com/photo1.jpg" },{ "url": "https://example.com/photo2.png" }]}
Compress with custom quality and resizing
{"images": [{ "url": "https://example.com/large-photo.jpg" }],"quality": 70,"maxWidth": 1200,"maxHeight": 800}
Compress Base64-encoded images
{"images": [{"base64": "data:image/png;base64,iVBORw0KGgo...","filename": "my-image.png"}]}
WebP-only output (skip original format)
{"images": [{ "url": "https://example.com/image.jpg" }],"returnOriginalFormat": false,"returnWebp": true}
Development
# Install dependenciesnpm install# Build TypeScriptnpm run build# Run locally (requires Apify CLI)apify run
License
ISC

