# Image Compressor & Converter: Bulk WebP, JPEG, PNG & Resize (`datadesk-io/image-compressor-converter`) Actor

Compress and convert images in bulk from URLs to WebP, JPEG or PNG. Resize to max width/height, set quality, strip EXIF, auto-rotate. Get download links plus original vs new size and % saved for every image. Failed images are free. $2 per 1,000 images.

- **URL**: https://apify.com/datadesk-io/image-compressor-converter.md
- **Developed by:** [DataDesk](https://apify.com/datadesk-io) (community)
- **Categories:** Developer tools, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.60 / 1,000 images

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Image Compressor & Converter: Bulk WebP, JPEG, PNG & Resize

**Compress and convert images in bulk** from URLs to **WebP, JPEG or PNG**. Set **quality**, **resize** to a max width/height (no upscaling), **strip EXIF** (camera, GPS) and **auto-rotate**. You get a **download link** for every converted file plus **original vs new size and % saved**. Failed images are listed and **not charged**. **$2 per 1,000 images.**

### Try it now (one click)

1. Click **Start**. The prefilled input converts a PNG to WebP. In our latest check (Nov 19, 2026) it returned **2 images in about 4 seconds**. An empty input runs a small demo too.
2. Paste image URLs, pick the output format and quality, and optionally a max width/height.
3. Download the results as CSV, Excel or JSON, or get them via API, webhooks, Make or Zapier.

**Price example:** 100 images = **$0.205**, 1,000 images = **$2.005** ($2.00 per 1,000 images + $0.005 per run). Silver and Gold plan users pay 10% and 20% less per image. Apify's free plan includes $5 of usage every month, enough for about 2,497 images. Runs that find nothing are not charged.

#### Sample of real results

*Real rows from a local test run on Nov 19, 2026 (some columns). Each image also includes the other fields listed below.*

| Original | Original bytes | Output | Output bytes | Saved % | Width | Height |
|---|---|---|---|---|---|---|
| png | 224,566 | webp | 64,296 | 71.4 | 800 | 600 |
| jpeg | 109,586 | webp | 38,798 | 64.6 | 1280 | 853 |
| jpeg | 109,586 | jpeg | 16,506 | 84.9 | 600 | 400 |
| png | 224,566 | jpeg | 14,240 | 93.7 | 600 | 450 |

### What you get

| Field group | Fields |
|---|---|
| Source | URL, detected format, bytes, width, height |
| Result | output format, bytes, width, height, bytes saved, % saved, quality |
| File | key in the run key-value store, direct download URL |
| Status | ok or failed with the reason (failed = not charged) |

### Why this Actor

- **Typical savings 60-90%** when converting PNG/JPEG to WebP (demo: 71% and 65%).
- **Resize + convert + strip metadata** in one pass.
- **Download links** you can use in other tools or push to your CDN.
- **Pay only for converted images:** $2 per 1,000; failures are free.
- **No external API**: images are processed inside the run.

### How to use it

1. Click **Try for free** (or **Start**): the prefilled input runs a quick test.
2. Paste image URLs, pick the output format and quality, and optionally a max width/height.
3. Click **Start** and wait a few seconds.
4. Open the **Output** tab and export as **JSON, CSV, Excel, XML or HTML**, or read the dataset via API.

### Input examples

**PNG to WebP (prefill):**

```json
{"imageUrls": ["https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png"]}
```

**Product photos to 1200px JPEG quality 75:**

```json
{"imageUrls": ["https://example.com/a.png", "https://example.com/b.jpg"], "outputFormat": "jpeg", "quality": 75, "maxWidth": 1200}
```

**Thumbnails 400px WebP:**

```json
{"imageUrls": ["https://example.com/photo.jpg"], "outputFormat": "webp", "quality": 70, "maxWidth": 400, "maxHeight": 400}
```

#### Input fields

| Field | Type | Description |
|---|---|---|
| `imageUrls` | array | Direct links to images (JPEG, PNG, WebP, GIF first frame, BMP, TIFF), one per line. Leave empty for a 2-image demo. |
| `outputFormat` | string | Format of the converted files. WebP is usually 25-80% smaller than PNG/JPEG. |
| `quality` | integer | Compression quality for WebP and JPEG. 75-85 is visually lossless for most photos. Ignored for PNG. |
| `maxWidth` | integer | Resize so the image is at most this wide (keeps aspect ratio, never upscales). 0 = keep original size. |
| `maxHeight` | integer | Resize so the image is at most this tall. 0 = keep original size. |
| `keepMetadata` | boolean | By default EXIF (camera, GPS) is removed for privacy and smaller files; photos are auto-rotated first. |
| `keepOriginalIfSmaller` | boolean | If the image is already in the target format and re-encoding would make it bigger (and no resize was asked), keep the original bytes. |
| `maxFileSizeMb` | integer | Skip images larger than this (listed as failed, not charged). |
| `maxImages` | integer | Hard cap for the whole run (cost control). |

### Output example

*Example record from a local test run (long lists shortened).*

```json
{
  "sourceUrl": "https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png",
  "status": "ok",
  "originalFormat": "png",
  "originalBytes": 224566,
  "originalWidth": 800,
  "originalHeight": 600,
  "outputFormat": "webp",
  "outputBytes": 64296,
  "outputWidth": 800,
  "outputHeight": 600,
  "savedBytes": 160270,
  "savedPercent": 71.4,
  "quality": 80,
  "outputKey": "img-8a059907ef6f.webp",
  "outputUrl": "https://api.apify.com/v2/key-value-stores/<storeId>/records/img-8a059907ef6f.webp",
  "scrapedAt": "2026-11-19T23:20:54.506662+00:00",
  "isNew": false
}
```

#### Output fields

| Field | Description |
|---|---|
| `sourceUrl` | Original image link |
| `status` | ok or failed (failed rows are not charged) |
| `error` | Why the image failed |
| `originalFormat` | Detected input format |
| `originalBytes` | Input file size in bytes |
| `originalWidth` | Input width (px) |
| `originalHeight` | Input height (px) |
| `outputFormat` | webp, jpeg or png |
| `outputBytes` | Converted file size in bytes |
| `outputWidth` | Output width (px) |
| `outputHeight` | Output height (px) |
| `savedBytes` | Bytes saved (negative = bigger) |
| `savedPercent` | Size reduction in percent |
| `quality` | Quality setting used |
| `outputKey` | Record key in the run key-value store |
| `outputUrl` | Direct link to the converted file |
| `scrapedAt` | When the row was saved (UTC) |
| `isNew` | Always false |

### Pricing

Pay-per-event: **$0.005** once per run that saves results + **$0.002 per image** ($2.00 / 1,000). Runs that save nothing are not charged.

| Images saved | Approx. cost |
|---|---|
| 20 | $0.045 |
| 100 | $0.205 |
| 1,000 | $2.005 |
| 10,000 | $20.005 |

### Use cases

- Speed up websites and Core Web Vitals by serving WebP
- Prepare e-commerce product images (resize + compress)
- Bulk thumbnails for catalogs and marketplaces
- Remove GPS/camera EXIF before publishing photos
- Pipeline step after an image or product scraper

### Integrations / API

Works with the Apify API, Schedules, webhooks, Make, Zapier, n8n and MCP. Example:

```bash
curl "https://api.apify.com/v2/acts/datadesk-io~image-compressor-converter/run-sync-get-dataset-items" \
  -H "Authorization: Bearer $APIFY_TOKEN" -H "Content-Type: application/json" \
  -d '{"imageUrls": ["https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png"]}'
```

Python:

```python
from apify_client import ApifyClient
client = ApifyClient("<APIFY_TOKEN>")
run = client.actor("datadesk-io/image-compressor-converter").call(run_input={"imageUrls": ["https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png"]})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)
```

### MCP

Use this Actor from an MCP client (Cursor, Claude Desktop, etc.) through the Apify MCP server (`datadesk-io/image-compressor-converter`).

### FAQ

**Where are the converted files?** In the run's key-value store. Each row has a direct `outputUrl` download link and the `outputKey`.

**Which input formats work?** JPEG, PNG, WebP, GIF (first frame), BMP, TIFF and most formats Pillow can read.

**Is transparency kept?** Yes for WebP and PNG. For JPEG, transparent areas become white.

**What does an empty input do?** It converts 2 demo images to WebP.

**Are failed images charged?** No. They appear with status "failed" and the reason, free of charge.

### Limitations

- Images must be publicly downloadable by URL (no login).
- Default max source size 25 MB (up to 100 MB).
- Animated GIF/WebP are converted from the first frame only.
- Converted files are kept as long as the run storage is retained by Apify (check your plan).

### Start now

Click **Start** to run the prefilled example, then adjust the input. Missing a field or filter? Open an issue on the **Issues** tab and tell us what you need.

### Support

Questions, bugs or a missing field? Email **datadesk.io@proton.me** or open an issue on the Actor page.

***

**ES:** Comprime y convierte imágenes en lote desde URLs a WebP, JPEG o PNG, con redimensionado, calidad y eliminación de EXIF. Enlaces de descarga y % de ahorro. $2 por 1.000 imágenes.
**PT:** Comprima e converta imagens em lote a partir de URLs para WebP, JPEG ou PNG, com redimensionamento, qualidade e remoção de EXIF. Links de download e % de economia. US$2 por 1.000 imagens.

# Actor input Schema

## `imageUrls` (type: `array`):

Direct links to images (JPEG, PNG, WebP, GIF first frame, BMP, TIFF), one per line. Leave empty for a 2-image demo.

## `outputFormat` (type: `string`):

Format of the converted files. WebP is usually 25-80% smaller than PNG/JPEG.

## `quality` (type: `integer`):

Compression quality for WebP and JPEG. 75-85 is visually lossless for most photos. Ignored for PNG.

## `maxWidth` (type: `integer`):

Resize so the image is at most this wide (keeps aspect ratio, never upscales). 0 = keep original size.

## `maxHeight` (type: `integer`):

Resize so the image is at most this tall. 0 = keep original size.

## `keepMetadata` (type: `boolean`):

By default EXIF (camera, GPS) is removed for privacy and smaller files; photos are auto-rotated first.

## `keepOriginalIfSmaller` (type: `boolean`):

If the image is already in the target format and re-encoding would make it bigger (and no resize was asked), keep the original bytes.

## `maxFileSizeMb` (type: `integer`):

Skip images larger than this (listed as failed, not charged).

## `maxImages` (type: `integer`):

Hard cap for the whole run (cost control).

## Actor input object example

```json
{
  "imageUrls": [
    "https://example.com/photo.jpg"
  ],
  "outputFormat": "webp",
  "quality": 80,
  "maxWidth": 1600,
  "maxHeight": 0,
  "keepMetadata": false,
  "keepOriginalIfSmaller": true,
  "maxFileSizeMb": 25,
  "maxImages": 1000
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "imageUrls": [
        "https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("datadesk-io/image-compressor-converter").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "imageUrls": ["https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png"] }

# Run the Actor and wait for it to finish
run = client.actor("datadesk-io/image-compressor-converter").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "imageUrls": [
    "https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png"
  ]
}' |
apify call datadesk-io/image-compressor-converter --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,datadesk-io/image-compressor-converter"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/BKB0EakAfkkzHgWs6/builds/Dxv3p4UUM5y7thMiO/openapi.json
