# Bulk Image Converter & Compressor – WebP, AVIF, JPEG, PNG (`rowharbor1988/image-converter`) Actor

Convert and compress images in bulk to WebP, AVIF, JPEG or PNG – from URLs or a dataset of another Actor. Resize, set quality, strip metadata and get download links for every converted image.

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

## Pricing

from $0.70 / 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

## Bulk Image Converter & Compressor – WebP, AVIF, JPEG, PNG

Convert, compress and resize hundreds of images in one run – from a list of URLs or **straight from the dataset of any other Actor** (e.g. a product or e-commerce scraper). Get small, web-ready files in **WebP, AVIF, JPEG or PNG**, ready to download or use via API.

- **Formats in:** JPEG, PNG, WebP, AVIF, GIF (first frame), TIFF, BMP, SVG
- **Formats out:** WebP, AVIF, JPEG (mozjpeg), PNG (optimised palette) – or keep the original format and just compress
- **Resize:** max width / height, aspect ratio kept, never enlarged
- **Auto-rotate** using the EXIF orientation, then **EXIF and GPS data removed** (privacy) – can be turned off
- **Size saving per image** and in total
- **Pay only for converted images** – broken links, non-images and unsupported files are listed with the reason and not charged

### Typical uses

- Make product images web-ready after scraping a shop (pass the dataset ID)
- Convert a whole image library to WebP or AVIF for faster pages and better Core Web Vitals
- Create resized versions (e.g. max 1200 px) for marketplaces, newsletters or CMS uploads
- Remove location data from photos before publishing them

### Input

| Field | Description |
|---|---|
| Image URLs | Direct image links |
| …or images from a dataset | Dataset ID from your account; image URLs are found in fields like `image`, `imageUrl`, `images`, `thumbnail` – or set *Image field* |
| Convert to | WebP (default), AVIF, JPEG, PNG or keep format |
| Quality | 1–100 (default 80) |
| Max width / height | Optional resize |
| Lossless, Remove metadata | Options |

### Output

The converted files are saved in the run's **key-value store** (Output tab → *Image files*). The dataset has one row per image:

```json
{
  "sourceUrl": "https://shop.example/img/blue-mug.png",
  "status": "success",
  "fileName": "blue-mug.webp",
  "fileUrl": "https://api.apify.com/v2/key-value-stores/…/records/blue-mug.webp",
  "sourceFormat": "png",
  "format": "webp",
  "width": 1200,
  "height": 800,
  "originalBytes": 845120,
  "outputBytes": 96402,
  "savedPercent": 88.6
}
```

SUMMARY: number of images, converted, failed (with reasons), total size before/after and saving in %.

### Pricing

Pay per converted image – no start fee, no monthly fee. Failed downloads, non-image URLs and unsupported files (e.g. HEIC) are **not charged**.

### Good to know

- Only publicly reachable image URLs can be downloaded.
- HEIC/HEIF (iPhone photos) is not supported yet. Animated GIFs are converted using the first frame.
- Very large images are fine (up to *Max file size*, default 25 MB per file).
- Use only images you have the rights to process.

### Support

Missing a format or option? Open an issue on the Actor's Issues tab – I answer quickly.

# Actor input Schema

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

Direct links to images (JPEG, PNG, WebP, AVIF, GIF, TIFF, BMP, SVG). Upload a list or paste URLs.

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

ID of a dataset in your account, e.g. the results of a product or e-commerce scraper. Image URLs are taken from fields like image, imageUrl, images, thumbnail – or from the field you set below.

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

Optional. Field name with the image URL(s), e.g. images or product.mainImage.

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

Target format for all images.

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

Lower = smaller files. 75–85 is visually lossless for photos.

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

Optional. Larger images are scaled down, aspect ratio is kept, small images are never enlarged.

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

Optional. Works together with max width.

## `lossless` (type: `boolean`):

Exact pixels, bigger files. Good for logos and screenshots.

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

Removes camera data and location from photos. Images are auto-rotated first, so they always display upright.

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

Upper limit per run.

## `maxFileMb` (type: `integer`):

Larger source files are skipped (not charged).

## `maxConcurrency` (type: `integer`):

How many images are downloaded and converted at the same time.

## Actor input object example

```json
{
  "imageUrls": [
    {
      "url": "https://www.python.org/static/img/python-logo.png"
    }
  ],
  "format": "webp",
  "quality": 80,
  "lossless": false,
  "stripMetadata": true,
  "maxImages": 1000,
  "maxFileMb": 25,
  "maxConcurrency": 5
}
```

# Actor output Schema

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

No description

## `files` (type: `string`):

No description

## `summary` (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": [
        {
            "url": "https://www.python.org/static/img/python-logo.png"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("rowharbor1988/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": [{ "url": "https://www.python.org/static/img/python-logo.png" }] }

# Run the Actor and wait for it to finish
run = client.actor("rowharbor1988/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": [
    {
      "url": "https://www.python.org/static/img/python-logo.png"
    }
  ]
}' |
apify call rowharbor1988/image-converter --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,rowharbor1988/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/ZHzFuMWrbzSEc1xdN/builds/0hLhO7EIEMmfMg5Ri/openapi.json
