# 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:** 1 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.10 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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

Download the OpenAPI definition: https://api.apify.com/v2/actors/0decFQCdbKwpNgiri/builds/kypKyXk5YbZHV78FP/openapi.json
