LighterImage - Image Compressor With No Quality Loss avatar
LighterImage - Image Compressor With No Quality Loss

Pricing

Pay per event

Go to Apify Store
LighterImage - Image Compressor With No Quality Loss

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

Jake Reinders

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

7 days ago

Last modified

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

ParameterTypeRequiredDefaultDescription
imagesarrayYes-Array of images to compress
images[].urlstringNo*-Public URL of image
images[].base64stringNo*-Base64-encoded image data
images[].keystringNo*-Key in default KV store
images[].filenamestringNo-Output filename
qualitynumberNo80-85Quality (1-100)
returnWebpbooleanNotrueGenerate WebP version
returnOriginalFormatbooleanNotrueReturn compressed original
maxWidthnumberNo-Max width for resizing
maxHeightnumberNo-Max height for resizing
tierstringNo"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

TierImages/RunMax File Size
Free1015 MB
Pro20030 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 dependencies
npm install
# Build TypeScript
npm run build
# Run locally (requires Apify CLI)
apify run

License

ISC