# Image Converter & Compressor — Resize, WebP/AVIF, Bulk (`actor-forge/image-converter`) Actor

Convert and compress images in bulk: JPEG, PNG, HEIC (iPhone), GIF, SVG, TIFF to WebP, AVIF, JPEG, PNG or PDF. Resize, hit a target file size, strip EXIF and GPS, merge images into one PDF, optional ZIP. $2 per 1,000 images.

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

## Pricing

from $2.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/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 — Resize, WebP/AVIF, Bulk

Convert and compress images in bulk: JPEG, PNG, HEIC (iPhone), GIF, SVG, TIFF to WebP, AVIF, JPEG, PNG or PDF. Resize, hit a target file size, strip EXIF and GPS, merge images into one PDF, optional ZIP. $2 per 1,000 images.

**Convert images to WebP, AVIF, JPEG or PNG, compress them and resize them in bulk.** Paste a list of image URLs (JPEG, PNG, WebP, AVIF, **HEIC/HEIF iPhone photos**, GIF, TIFF or SVG; the format is read from the file itself) and get each one back **converted, compressed and optionally resized**, with a **direct download link** and a row showing the **file size before and after and the % saved**. Set a **max width/height** (fit inside, crop to cover, or pad to contain), a **quality** level, or a **target file size in KB** and the actor lowers the quality, then the dimensions, until each image fits. **EXIF metadata, including GPS location, is stripped by default** after photos are rotated upright, so you never publish where a photo was taken; each row still tells you whether the original had EXIF or GPS. PNG compression uses palette quantisation, the technique behind TinyPNG, so it works as a **bulk TinyPNG alternative** with no 20-image limit. Animated GIFs stay animated as WebP, SVGs are rasterised at the size you ask for, and you can download everything as **ZIP files**. Choose **PDF** as the output to **merge images into one PDF** (fit-to-image, A4 or Letter pages, with margins) or make one PDF per image. Use it to compress images for website speed and Core Web Vitals, convert product photos for an e-commerce catalogue, generate thumbnails, prepare images for a CMS or CDN migration, or as an image tool for AI agents and automation pipelines. **$2 per 1,000 images** with no compute bill on top, versus $10 per 1,000 with the leading converter. Failed and unsupported images are never charged.

### What data does it return?

Every run outputs clean, schema-validated rows like these:

| fileName | format | width | height | originalFormat | originalBytes | outputBytes | savedPercent | hadGps |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| 00012-AMISOM_Police_Officers_attending_a_briefing.webp | webp | 5184 | 3456 | jpeg | 6545941 | 696450 | 89.4 | false |
| 00003-Maharaja_Jagat_Singh_of_Jaipur.webp | webp | 960 | 738 | jpeg | 276908 | 138682 | 49.9 | false |
| 00032-EDDI_06wk_19970324.webp | webp | 1024 | 1024 | png | 285110 | 99856 | 65 | false |
| 00009-Washington_primary_results_map.webp | webp | 810 | 535 | svg | 770420 | 35256 | 95.4 | false |

### How much does it cost?

Transparent pay-per-event pricing — you only pay for what you get, and the
actor **always respects your run budget**: set a maximum total charge and it
stops cleanly at the cap instead of overrunning.

| Event | Price | Charged | Worked example |
| --- | --- | --- | --- |
| `image-processed` | $0.002 | per output image converted and delivered (resize, compression, metadata stripping, size targeting and ZIP included) | 100 images = $0.20; 1,000 images = $2.00; 10,000 images = $20 |
| `large-image` | $0.002 | per source image over 25 megapixels (all frames count for kept animations; added on top of image-processed; up to 50 MP accepted) | A 36 MP camera photo = $0.002 + $0.002 = $0.004; a 12 MP phone photo has no add-on |
| `heic-decoded` | $0.001 | per HEIC/HEIF source image decoded (iPhone photos; added on top of image-processed) | 100 iPhone photos to JPEG = 100 × ($0.002 + $0.001) = $0.30 |
| `pdf-created` | $0.002 | per PDF file created (each page image is also one image-processed) | 10 images merged into one PDF = 10 × $0.002 + $0.002 = $0.022; 10 images as 10 separate PDFs = $0.04 |
| `apify-actor-start` | $0.00005 | per run per GB of memory (platform start fee) | One run at 1 GB = $0.00005 |

### Input options

| Field | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `imageUrls` | array | yes | — | Direct links to the images to convert (JPEG, PNG, WebP, AVIF, HEIC/HEIF from iPhones, GIF, TIFF or SVG; the format is detected from the file itself). Up to 25 MB and 50 megapixels per image. To convert every image on a web page, collect the links first with our Bulk Image Downloader. |
| `format` | string | no | `"webp"` | WebP is the best all-round choice for websites (about 25-35% smaller than JPEG). AVIF is smaller still but slower to encode. JPEG is the most compatible (e.g. for iPhone HEIC photos). PDF puts the images into a PDF document (see the PDF options below). 'Keep' re-compresses each image in its own format (SVG becomes PNG, HEIC becomes JPEG). |
| `quality` | integer | no | `80` | Lower = smaller files. 75-85 is visually lossless for most photos. For PNG, anything below 100 reduces the colour palette (the TinyPNG technique); 100 = lossless. |
| `width` | integer | no | — | Resize so the image is at most this wide. Empty = keep the original width. Images are never enlarged. |
| `height` | integer | no | — | Resize so the image is at most this tall. Empty = keep the original height. |
| `fit` | string | no | `"inside"` | When both width and height are set: 'inside' keeps the aspect ratio within the box, 'cover' crops to fill the box exactly, 'contain' pads to the box with the background colour. |
| `background` | string | no | `"#ffffff"` | Hex colour used for padding ('contain') and for transparent areas when converting to JPEG. |
| `stripMetadata` | boolean | no | `true` | Remove EXIF, GPS location, camera details, XMP and IPTC from the output (photos are rotated upright first). Smaller files and no leaked locations. Each row still reports whether the original had EXIF / GPS. |
| `maxFileSizeKb` | number | no | — | Optional. Lowers the quality step by step (and, if needed, the dimensions) until each image fits under this size. Rows show the quality used and whether the target was met. |
| `keepAnimation` | boolean | no | `true` | Animated GIF or WebP converted to WebP keep all frames. Off = first frame only. AVIF, JPEG and PNG output always use the first frame. |
| `outputMode` | string | no | `"links"` | 'Links' saves each image with its own download link. 'ZIP' bundles all images into ZIP files (up to 200 MB each; links in the OUTPUT record). 'Both' does both. A merged PDF is always a download link. |
| `filenamePattern` | string | no | `"{index}-{name}"` | Tokens: {index} (00001…), {name} (original file name), {width}, {height}, {format}. The extension is added automatically; duplicate names get a -2, -3… suffix. |
| `maxImages` | integer | no | `1000` | Stop after converting this many images. |
| `pdfMode` | string | no | `"merge"` | 'Merge' puts all images into one PDF, one image per page, in the order of your list. 'Separate' makes one PDF per image. |
| `pdfPageSize` | string | no | `"fit"` | 'Fit image' makes each page exactly the size of its image (96 dpi). A4 and Letter pages turn portrait or landscape to match each image, which is scaled to fill the page inside the margin. |
| `pdfMarginMm` | integer | no | `10` | White margin around the image on A4 and Letter pages. 'Fit image' pages have no margin. |
| `pdfFileName` | string | no | `"images"` | Name of the merged PDF (without .pdf). Very large merges are split into parts: name.pdf, name-part-2.pdf, ... |

### Limits & honest notes

- Input: direct image URLs. To convert every image on a web page, collect the links first with our Bulk Image Downloader and pass them in.
- Each source image can be up to 25 MB and 50 megapixels (animations up to 100 MP across all frames). Larger files are reported as errors and not charged.
- Sources over 25 megapixels cost a second `large-image` event ($0.002), because they take far more compute. Everyday photos (12-24 MP phone pictures) are not affected.
- Supported inputs: JPEG, PNG, WebP, AVIF, HEIC/HEIF, GIF (incl. animated), TIFF and SVG. BMP and ICO are not supported and are reported as errors (not charged).
- HEIC/HEIF (iPhone photos): the primary image of each file is converted (bursts and multi-image files give one image), upright as the phone displays it, with Display P3 colours converted to standard sRGB. EXIF from HEIC files is not copied to the output even with metadata stripping off (the colour profile is). HEIC decoding is slower, so it adds a `heic-decoded` event ($0.001); for 48 MP HEIC photos run with 2 GB of memory or more.
- PDF output: one image per page, in the order of your list. Photos are embedded as JPEG at your quality setting, PNG/GIF/TIFF/SVG as lossless PNG so text stays sharp. Merged PDFs larger than about 128 MB (at 1 GB memory) are split into parts. PDF output ignores the ZIP option when merging.
- Animation is kept for GIF/WebP to WebP; AVIF, JPEG and PNG output use the first frame. SVGs are rasterised; references to external files or URLs inside an SVG are never loaded.
- Images are never enlarged beyond their original size. Converting to JPEG fills transparent areas with the background colour (default white).
- A target file size is a best effort: if an image can't reach it at minimum quality after one resize, it is delivered as small as possible and the row says `targetMet: false`.
- Stripping metadata also converts colours to standard sRGB. Turn stripping off to keep EXIF, ICC colour profiles, XMP and IPTC.
- Download links work for the lifetime of the run's storage (Apify's default retention for your plan). ZIP files are split into parts of up to 200 MB.
- Internal and private network addresses are always refused, including through redirects or DNS tricks. Only convert images you have the right to use.
- Respects your run budget: set a maximum total charge and the actor stops cleanly at the cap.

### Related ActorForge actors

- [HEIC to JPG Converter](https://apify.com/actor-forge/heic-to-jpg)
- [Images to PDF Converter](https://apify.com/actor-forge/images-to-pdf)
- [Bulk Image Downloader](https://apify.com/actor-forge/bulk-image-downloader) — collect the images first
- [Image to Text OCR](https://apify.com/actor-forge/image-to-text-ocr)

### Changelog

- **2026-10-19** — HEIC/HEIF input (iPhone photos, libheif wasm decoder) and PDF output: merge images into one PDF (fit, A4 or Letter pages) or one PDF per image.
- **2026-10-19** — Initial release: WebP/AVIF/JPEG/PNG conversion, resize (inside/cover/contain), quality and target-size compression, EXIF/GPS stripping with auto-rotate, animated GIF to WebP, SVG rasterising, file name patterns, ZIP export.

***

*Built and maintained by **ActorForge**. Reliability first: every actor in the
portfolio is monitored by an automated nightly self-test, and breakages are
typically fixed the same day.*

# Actor input Schema

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

Direct links to the images to convert (JPEG, PNG, WebP, AVIF, HEIC/HEIF from iPhones, GIF, TIFF or SVG; the format is detected from the file itself). Up to 25 MB and 50 megapixels per image. To convert every image on a web page, collect the links first with our Bulk Image Downloader.

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

WebP is the best all-round choice for websites (about 25-35% smaller than JPEG). AVIF is smaller still but slower to encode. JPEG is the most compatible (e.g. for iPhone HEIC photos). PDF puts the images into a PDF document (see the PDF options below). 'Keep' re-compresses each image in its own format (SVG becomes PNG, HEIC becomes JPEG).

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

Lower = smaller files. 75-85 is visually lossless for most photos. For PNG, anything below 100 reduces the colour palette (the TinyPNG technique); 100 = lossless.

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

Resize so the image is at most this wide. Empty = keep the original width. Images are never enlarged.

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

Resize so the image is at most this tall. Empty = keep the original height.

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

When both width and height are set: 'inside' keeps the aspect ratio within the box, 'cover' crops to fill the box exactly, 'contain' pads to the box with the background colour.

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

Hex colour used for padding ('contain') and for transparent areas when converting to JPEG.

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

Remove EXIF, GPS location, camera details, XMP and IPTC from the output (photos are rotated upright first). Smaller files and no leaked locations. Each row still reports whether the original had EXIF / GPS.

## `maxFileSizeKb` (type: `number`):

Optional. Lowers the quality step by step (and, if needed, the dimensions) until each image fits under this size. Rows show the quality used and whether the target was met.

## `keepAnimation` (type: `boolean`):

Animated GIF or WebP converted to WebP keep all frames. Off = first frame only. AVIF, JPEG and PNG output always use the first frame.

## `outputMode` (type: `string`):

'Links' saves each image with its own download link. 'ZIP' bundles all images into ZIP files (up to 200 MB each; links in the OUTPUT record). 'Both' does both. A merged PDF is always a download link.

## `filenamePattern` (type: `string`):

Tokens: {index} (00001…), {name} (original file name), {width}, {height}, {format}. The extension is added automatically; duplicate names get a -2, -3… suffix.

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

Stop after converting this many images.

## `pdfMode` (type: `string`):

'Merge' puts all images into one PDF, one image per page, in the order of your list. 'Separate' makes one PDF per image.

## `pdfPageSize` (type: `string`):

'Fit image' makes each page exactly the size of its image (96 dpi). A4 and Letter pages turn portrait or landscape to match each image, which is scaled to fill the page inside the margin.

## `pdfMarginMm` (type: `integer`):

White margin around the image on A4 and Letter pages. 'Fit image' pages have no margin.

## `pdfFileName` (type: `string`):

Name of the merged PDF (without .pdf). Very large merges are split into parts: name.pdf, name-part-2.pdf, ...

## Actor input object example

```json
{
  "imageUrls": [
    "https://upload.wikimedia.org/wikipedia/commons/3/3f/JPEG_example_flower.jpg",
    "https://www.gstatic.com/webp/gallery3/1.png"
  ],
  "format": "webp",
  "quality": 80,
  "fit": "inside",
  "background": "#ffffff",
  "stripMetadata": true,
  "keepAnimation": true,
  "outputMode": "links",
  "filenamePattern": "{index}-{name}",
  "maxImages": 1000,
  "pdfMode": "merge",
  "pdfPageSize": "fit",
  "pdfMarginMm": 10,
  "pdfFileName": "images"
}
```

# Actor output Schema

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

One row per converted image (or per merged PDF) with a download link, format, dimensions, bytes before and after and % saved.

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

Totals (images converted, bytes before and after) and download links for ZIP and PDF files.

# 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/3/3f/JPEG_example_flower.jpg",
        "https://www.gstatic.com/webp/gallery3/1.png"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("actor-forge/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/3/3f/JPEG_example_flower.jpg",
        "https://www.gstatic.com/webp/gallery3/1.png",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("actor-forge/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/3/3f/JPEG_example_flower.jpg",
    "https://www.gstatic.com/webp/gallery3/1.png"
  ]
}' |
apify call actor-forge/image-converter --silent --output-dataset

```

## MCP server setup

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