# Bulk Image Converter & Optimizer (`gp005/bulk-image-converter`) Actor

Convert, resize, compress, and strip metadata from many images at once — to WebP, AVIF, JPEG, or PNG. Use as a serverless image optimization API for bulk image conversion, compression, and resizing. Pure compute on image URLs you supply; no scraping.

- **URL**: https://apify.com/gp005/bulk-image-converter.md
- **Developed by:** [Geo](https://apify.com/gp005) (community)
- **Categories:** Developer tools, Automation
- **Stats:** 2 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$3.00 / 1,000 image processeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## Bulk Image Converter & Optimizer

Convert, resize, compress, and strip metadata from **many images at once** — to **WebP, AVIF, JPEG, or PNG**. Point it at a list of image URLs; get back optimized images (with download URLs) and a size-savings report. Pure compute on images you supply — **no scraping, no personal data** (in fact, it *removes* EXIF/GPS by default).

This **bulk image converter** is designed for developers and site owners who need a programmable **image optimization API** that scales to thousands of images without queuing, uploads, or manual clicks.

### Use cases
- **Web performance** — bulk-convert a media library to WebP/AVIF and cut page weight 70–90%.
- **Thumbnails / responsive images** — **bulk image resize** to a max width/height in one pass.
- **Format migration** — normalize a mixed folder (PNG/JPEG/legacy formats) to one modern format.
- **Privacy** — strip EXIF/GPS metadata from images before publishing.

### How to use it (quick start)

1. Feed the Actor a JSON array of image URLs via `imageUrls`.
2. Choose your output `format`: `webp`, `avif`, `jpeg`, `png`, or `original`.
3. Optionally set `quality` (1–100), max `width`/`height`, and `fit` behaviour.
4. Run the Actor. Each converted image produces a dataset row with an `outputUrl` you can download directly — no separate storage step needed.
5. Pass the output URLs to a CDN, CMS, or static-site pipeline for immediate deployment.

### Input
`imageUrls` (required) · `format` (webp / avif / jpeg / png / original) · `quality` (1–100) · `width` / `height` (max px, aspect preserved) · `fit` (inside / cover / contain) · `stripMetadata` (default true).

```json
{ "imageUrls": ["https://site.com/a.jpg", "https://site.com/b.png"], "format": "webp", "quality": 75, "width": 1200 }
````

### Output

One dataset item per image: `status`, `sourceUrl`, **`outputUrl`** (download the converted image from the run's key-value store), `format`, `width`, `height`, `originalBytes`, `outputBytes`, **`savedPct`**. Failed fetches/decodes return a structured `error` item (never charged).

### Pricing (pay-per-event) & cost example

| Event | Price | When |
|---|--:|---|
| `image-processed` (primary) | $0.003 | per image successfully converted |

**1,000 images → $3.00.** Measured platform compute + transfer is **well under $0.10** for that batch (<3% of revenue). Failed images are never charged.

As a **bulk image compressor**, this is one of the most cost-effective ways to optimise a media library programmatically.

### Integrate

Chain it after any Actor that outputs image URLs, or call it via the **REST API / MCP / Make / n8n**. Converted files live in the run's key-value store (download via `outputUrl`).

More FORGE actors for site health and data work:

- **[SSL/TLS Certificate Expiry Monitor](https://apify.com/gp005/tls-cert-monitor)** — track certificate expiry and changes for your domains, with alerts.
- **[Security Headers Auditor](https://apify.com/gp005/security-headers-auditor)** — grade HTTP security headers (CSP, HSTS, COOP/COEP) for any URL, 0–100 with fixes.
- **[GEO & llms.txt Auditor](https://apify.com/gp005/geo-llms-auditor)** — see which AI crawlers your site allows or blocks and score AI citability.
- **[SEC EDGAR Filings & XBRL Fundamentals](https://apify.com/gp005/edgar-xbrl-fundamentals)** — company filings and normalized financial fundamentals as JSON.

### FAQ

**What image formats can I convert to?** WebP, AVIF, JPEG, PNG, or keep the original format. The default is WebP — the best balance of size and quality for most use cases.

**Can I use this as a bulk image compressor without losing quality?** Yes. At quality=100 there is virtually no visible degradation (especially for WebP and AVIF), but file sizes drop significantly vs. uncompressed JPEGs.

**Does it strip EXIF and GPS data?** Yes, by default. Orientation is applied before stripping so your images look right even after metadata removal. Set `stripMetadata: false` to preserve EXIF if needed.

**Is there a limit on how many images I can process?** No hard limit — you set `imageUrls` to any array length. Processing is billed per-image at $0.003. For very large batches, consider splitting across multiple runs.

**Can I process HEIC images from an iPhone?** Not currently — the prebuilt image engine (sharp/libvips) does not include the patent-encumbered HEIC/HEVC codec. Supported inputs include JPEG, PNG, WebP, AVIF, GIF, TIFF, and SVG; a HEIC URL returns a structured error item (never charged). Convert HEIC to JPEG on-device first.

**How do I download the converted images?** Each dataset row includes an `outputUrl` field — a direct download link to the optimized file in the run's key-value store. You can also chain to another Actor for upload to S3, CDN, or CMS.

**Do I need to upload images?** No — the Actor fetches images by URL. Point it at any publicly accessible image URL; no uploads required.

### Limitations

- Fetches images by **URL** (one polite request each); it does not crawl pages to discover images.
- Output images are stored in the run's key-value store (retention per your Apify plan).
- Animated formats are converted to a single frame unless the target format supports animation.
- Built on **sharp / libvips** (Apache-2.0 / LGPL) — permissive, commercial-friendly.

# Actor input Schema

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

Direct URLs of the images to convert/optimize. Each is fetched once and processed.

## `format` (type: `string`):

Target image format. 'original' keeps the source format and only resizes/optimizes.

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

Compression quality for lossy formats (WebP/AVIF/JPEG). Lower = smaller file.

## `width` (type: `integer`):

Resize so width fits within this many pixels (aspect ratio preserved). Leave empty to keep original width.

## `height` (type: `integer`):

Resize so height fits within this many pixels (aspect ratio preserved). Leave empty to keep original height.

## `fit` (type: `string`):

How to fit the image within the given width/height.

## `stripMetadata` (type: `boolean`):

Remove EXIF and other metadata (including GPS) from the output. Orientation is auto-applied first.

## Actor input object example

```json
{
  "imageUrls": [
    "https://example.com/photo1.jpg",
    "https://example.com/photo2.png"
  ],
  "format": "webp",
  "quality": 80,
  "fit": "inside",
  "stripMetadata": true
}
```

# Actor output Schema

## `dataset` (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/a/a9/Example.jpg",
        "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("gp005/bulk-image-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/a/a9/Example.jpg",
        "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("gp005/bulk-image-converter").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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/a/a9/Example.jpg",
    "https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png"
  ]
}' |
apify call gp005/bulk-image-converter --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=gp005/bulk-image-converter",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Bulk Image Converter & Optimizer",
        "description": "Convert, resize, compress, and strip metadata from many images at once — to WebP, AVIF, JPEG, or PNG. Use as a serverless image optimization API for bulk image conversion, compression, and resizing. Pure compute on image URLs you supply; no scraping.",
        "version": "0.1",
        "x-build-id": "kypKyXk5YbZHV78FP"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/gp005~bulk-image-converter/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-gp005-bulk-image-converter",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/gp005~bulk-image-converter/runs": {
            "post": {
                "operationId": "runs-sync-gp005-bulk-image-converter",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/gp005~bulk-image-converter/run-sync": {
            "post": {
                "operationId": "run-sync-gp005-bulk-image-converter",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "imageUrls"
                ],
                "properties": {
                    "imageUrls": {
                        "title": "Image URLs",
                        "type": "array",
                        "description": "Direct URLs of the images to convert/optimize. Each is fetched once and processed.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "format": {
                        "title": "Output format",
                        "enum": [
                            "webp",
                            "avif",
                            "jpeg",
                            "png",
                            "original"
                        ],
                        "type": "string",
                        "description": "Target image format. 'original' keeps the source format and only resizes/optimizes.",
                        "default": "webp"
                    },
                    "quality": {
                        "title": "Quality (1-100)",
                        "minimum": 1,
                        "maximum": 100,
                        "type": "integer",
                        "description": "Compression quality for lossy formats (WebP/AVIF/JPEG). Lower = smaller file.",
                        "default": 80
                    },
                    "width": {
                        "title": "Max width (px, optional)",
                        "minimum": 1,
                        "maximum": 10000,
                        "type": "integer",
                        "description": "Resize so width fits within this many pixels (aspect ratio preserved). Leave empty to keep original width."
                    },
                    "height": {
                        "title": "Max height (px, optional)",
                        "minimum": 1,
                        "maximum": 10000,
                        "type": "integer",
                        "description": "Resize so height fits within this many pixels (aspect ratio preserved). Leave empty to keep original height."
                    },
                    "fit": {
                        "title": "Resize fit",
                        "enum": [
                            "inside",
                            "cover",
                            "contain"
                        ],
                        "type": "string",
                        "description": "How to fit the image within the given width/height.",
                        "default": "inside"
                    },
                    "stripMetadata": {
                        "title": "Strip metadata (EXIF/GPS)",
                        "type": "boolean",
                        "description": "Remove EXIF and other metadata (including GPS) from the output. Orientation is auto-applied first.",
                        "default": true
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
