# Image Converter & Compressor: Bulk WebP, JPG, PNG from CSV (`nerolabs/bulk-image-converter`) Actor

Converts, compresses and resizes images to WebP, JPEG, PNG or AVIF and returns a stable link, size and dimensions for each. Input: image links, dataset, CSV or Google Sheet (columns kept). $0.002 per image converted; failures free. Agent-ready via x402 and MCP.

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

## Pricing

from $1.40 / 1,000 image converteds

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 Converter & Compressor: Bulk WebP, JPG, PNG from CSV

**Turn a whole list of image links into WebP, JPEG, PNG or AVIF in one run: compressed, resized to your maximum, and each one handed back as a working link with its new size.**

Scraped a catalogue of product photos, a property site's listing images or a folder of PNGs that are far too heavy for your website? Paste the links, or point this at the Apify dataset your scraper made, a CSV, an Excel file or a Google Sheet. Every row comes back with its original columns plus the converted image.

**$0.002 per image converted** ($2 per 1,000). Broken links and files that are not images are free.

### What you get for each image

| Column | What it is |
|---|---|
| `convertedUrl` | A stable link to the converted file in your run's storage (or a named store you choose) |
| `format`, `width`, `height` | The new file, measured |
| `originalFormat`, `originalWidth`, `originalHeight` | The source, measured |
| `originalBytes`, `convertedBytes`, `savedPercent` | How much smaller it got |
| `storeKey` | The file name in storage, so you can download them all at once |
| `status`, `statusDetail` | `ok`, or a plain reason (link broken, blocked, not an image, too large) |

### Example

Three real images, converted to WebP with a maximum width of 800 px:

| source | was | now | smaller by |
|---|---|---|---|
| 1280 px JPEG photo (110 KB) | jpeg 1280x853 | webp 800x533, 19 KB | 83% |
| 800 px PNG with transparency (225 KB) | png 800x600 | webp 800x600, 69 KB | 69% |
| 550 px JPEG (45 KB) | jpeg 550x368 | webp 550x368, 39 KB | 14% |

### Options

- **Convert to:** WebP (default), JPEG, PNG, AVIF, or keep the original format and only resize or compress.
- **Quality:** 1 to 100, default 80.
- **Maximum width and height:** shrink anything bigger, keeping proportions. Small images are never blown up unless you allow it. Fit inside, crop to fill, pad to an exact box, or stretch.
- **Remove metadata:** strips EXIF and GPS data (on by default). Phone photos are turned the right way up first.
- **Background colour:** for transparent areas when converting to JPEG.
- **File names:** from any column (for example `sku`), or the source file's name.
- **Named store:** keep the files until you delete them, instead of your plan's normal storage retention.
- Export the result table to CSV or Excel, append to a named dataset.

### Use it straight after a scraper

On your scraper's **Integrations** tab, add this Actor. The Dataset field fills in by itself with `{{resource.defaultDatasetId}}`, so every scraper run's images are converted automatically.

### What it costs

| Event | Price |
|---|---|
| Image converted | $0.002 |
| CSV or Excel export file | $0.01 |

1,000 images cost **$2**. Broken links, blocked downloads, files that are not images and files over your size limit are **not charged**.

### For AI agents and automations

Pay per event, no subscription, callable through the Apify API, MCP (`nerolabs/bulk-image-converter`) and x402. Send `{"imageUrls": ["https://..."], "format": "webp", "maxWidth": 1200}` and read `convertedUrl` from the dataset.

### The rest of the toolkit

[Bulk Image Downloader](https://apify.com/nerolabs/bulk-file-downloader) saves originals as they are, [AI Image Upscaler](https://apify.com/nerolabs/bulk-image-upscaler) makes small or blurry photos bigger and sharper, [Logo & Favicon Extractor](https://apify.com/nerolabs/logo-favicon-finder) finds company logos, and [Dataset Filter & Transform](https://apify.com/nerolabs/dataset-filter-transform) shapes the table.

***

If this saved you converting images one at a time, a review on the Store page helps a lot. If something looks wrong, open an issue on the Issues tab and I will answer personally.

# Actor input Schema

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

Direct links to images, one per line (jpg, png, webp, gif, avif, tiff, heic, svg). Leave empty to read a dataset, a file or a Google Sheet instead.

## `datasetId` (type: `string`):

An Apify dataset, for example the output of a product, real estate or social media scraper. The image column is found automatically and every original column comes back with the converted image link added.

## `fileUrl` (type: `string`):

A public link to a CSV, TSV, Excel, JSON or JSON Lines file with one row per image. A normal Google Sheets link works: share it as 'Anyone with the link can view'.

## `fileFormat` (type: `string`):

Leave on 'Detect automatically' unless the link has no file extension and the server reports the wrong content type.

## `sheetName` (type: `string`):

Which sheet to read from an Excel workbook. Defaults to the first sheet.

## `data` (type: `array`):

Rows as inline JSON, an alternative to a dataset or file. Each object needs a field holding the image link.

## `imageField` (type: `string`):

The column that holds the image link. Leave empty to detect it (image, imageUrl, thumbnail, photo, src, url...).

## `fileNameField` (type: `string`):

Optional. A column to name each output file by (for example 'sku' or 'title'). Default: the source file's name.

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

The output format.

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

Lower is smaller. 75 to 85 looks the same as the original for most photos.

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

Optional. Shrink anything wider, keeping the proportions. Images are never enlarged unless you allow it.

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

Optional. Shrink anything taller, keeping the proportions.

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

How to fit an image when both a maximum width and height are set.

## `background` (type: `string`):

Used behind transparent areas when converting to JPEG, and for padding with 'Fit inside and pad'.

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

Removes camera and location data and makes files smaller. Photos are turned the right way up first.

## `allowEnlarge` (type: `boolean`):

Off: a small image keeps its size even if the maximum is bigger.

## `outputStoreName` (type: `string`):

Optional. Save the converted files into a named store that is kept until you delete it, instead of the run's own store (kept for your plan's retention period).

## `keepOriginalFields` (type: `boolean`):

Return every input column alongside the new ones.

## `exportFormats` (type: `array`):

Also write the result table as a downloadable CSV or Excel file. $0.01 per file, charged only when at least one image was converted.

## `outputDatasetName` (type: `string`):

Also append every row to a named dataset that persists across runs. Not charged again.

## `proxyConfiguration` (type: `object`):

Optional. Off by default; most image hosts answer directly.

## `concurrency` (type: `integer`):

How many images to download and convert in parallel. More needs more memory.

## `requestTimeoutSecs` (type: `integer`):

How long to wait for one image.

## `maxImageMb` (type: `integer`):

Skip (free) any source file larger than this.

## `maxItems` (type: `integer`):

Stop after this many input rows.

## Actor input object example

```json
{
  "imageUrls": [
    "https://upload.wikimedia.org/wikipedia/commons/thumb/a/a7/Camponotus_flavomarginatus_ant.jpg/1280px-Camponotus_flavomarginatus_ant.jpg",
    "https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png",
    "https://www.gstatic.com/webp/gallery/1.jpg"
  ],
  "fileFormat": "auto",
  "format": "webp",
  "quality": 80,
  "fit": "inside",
  "background": "#ffffff",
  "stripMetadata": true,
  "allowEnlarge": false,
  "keepOriginalFields": true,
  "exportFormats": [],
  "proxyConfiguration": {
    "useApifyProxy": false
  },
  "concurrency": 4,
  "requestTimeoutSecs": 30,
  "maxImageMb": 30
}
```

# Actor output Schema

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

Every original row with the converted image link, format, size and how much smaller it is.

## `summary` (type: `string`):

Images converted, total size before and after, status counts and export links.

# 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/thumb/a/a7/Camponotus_flavomarginatus_ant.jpg/1280px-Camponotus_flavomarginatus_ant.jpg",
        "https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png",
        "https://www.gstatic.com/webp/gallery/1.jpg"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("nerolabs/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/thumb/a/a7/Camponotus_flavomarginatus_ant.jpg/1280px-Camponotus_flavomarginatus_ant.jpg",
        "https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png",
        "https://www.gstatic.com/webp/gallery/1.jpg",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("nerolabs/bulk-image-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/thumb/a/a7/Camponotus_flavomarginatus_ant.jpg/1280px-Camponotus_flavomarginatus_ant.jpg",
    "https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png",
    "https://www.gstatic.com/webp/gallery/1.jpg"
  ]
}' |
apify call nerolabs/bulk-image-converter --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,nerolabs/bulk-image-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/LqqdPTRB0gcZ6xjJ8/builds/pbgHWtjLe6zvRhvEO/openapi.json
