# Image Converter, Compressor & Resizer — WebP, AVIF, HEIC (`steadyscrape/image-converter-compressor`) Actor

Bulk image converter and compressor: JPG, PNG, WebP, AVIF, GIF, SVG and iPhone HEIC to WebP, AVIF, JPEG or PNG. Quality, lossless, max file size in KB, resize, EXIF auto-rotate, strip metadata. Links, Google Drive, Dropbox or datasets in, ZIP out. Export to JSON, CSV or Excel, or via API.

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

## Pricing

from $1.00 / 1,000 web 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.

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 & Resizer — WebP, AVIF, JPEG, PNG, HEIC

**Image converter and image compressor in bulk**: give links to your images (or upload them, or pick a dataset or a
key-value store) and get each one back as **WebP, AVIF, JPEG or PNG** — compressed, resized, turned upright and stripped
of metadata if you want — with a public download link, its new size and how much it saved, plus **one ZIP of every
image**. Converts JPG, PNG, WebP, AVIF, GIF (animated too), TIFF, SVG and **iPhone HEIC** photos. From US$0.001 per image.

### What this image converter and compressor does

- **Convert images to WebP or AVIF** for faster pages and better Core Web Vitals, to **JPEG** for anything that must open
  everywhere, or to **PNG** for lossless screenshots and logos. Or keep each image's own format and only compress it.
- **Compress images**: choose a quality (or use each format's tested default), lossless WebP/AVIF, PNG reduced to a
  256-colour palette (TinyPNG-style), or a **target size in KB** — the quality is lowered until the image fits, then the
  image is made smaller.
- **Resize images in bulk**: a longest side (1920, 1200, 400…), or a width and height with *inside*, *cover* (crop to
  fill: square thumbnails), *contain* (pad) or *fill*. Never enlarges a smaller image unless you ask.
- **HEIC to JPG**: iPhone photos (HEIC/HEIF, HEVC-coded) are decoded and turned into JPEG, WebP, AVIF or PNG, upright,
  with their colour profile — and their EXIF, GPS and date when you keep metadata.
- **Auto-rotate from EXIF** so phone photos show the right way everywhere, and **strip EXIF/GPS** for privacy (or keep
  only the colour profile, or keep everything).
- **Animated GIFs to animated WebP** keep every frame.
- One dataset row per image with the original and new format, width, height, bytes, savings %, quality used, SHA-256 and
  a **signed public link** that opens without an Apify login; one **ZIP** link for all of them in the run's `SUMMARY`.

### Use cases

- **E-commerce and SEO**: turn a product catalogue's JPEGs and PNGs into WebP or AVIF at 1200 px before an upload, so
  pages load faster. Feed it the dataset of a product scraper or of
  [Bulk Image Downloader](https://apify.com/steadyscrape/bulk-image-downloader).
- **Upload limits**: get every image under 200 KB (`maxFileSizeKb`) for a marketplace, a CMS or an email.
- **iPhone photos**: convert a folder of HEIC photos shared from Google Drive or Dropbox to JPEG for Windows, the web or
  a print shop.
- **Thumbnails**: square 400 × 400 crops (`width` 400, `height` 400, `fit` cover).
- **Privacy**: strip GPS and camera data from photos before publishing them.
- **Automation and AI agents**: one API call converts and resizes the images another Actor produced (screenshots,
  downloads) and returns links ready to use.

### Input

```json
{
    "imageUrls": [
        "https://upload.wikimedia.org/wikipedia/commons/e/e1/FullMoon2010.jpg",
        "https://drive.google.com/file/d/1AbC…/view?usp=sharing"
    ],
    "format": "webp",
    "quality": 80,
    "longestSide": 1600,
    "maxFileSizeKb": 300,
    "autoRotate": true,
    "metadata": "strip"
}
```

Sources, all in one run: `imageUrls` (http/https links, Google Drive and Dropbox share links shared with anyone with the
link, signed Apify record links), `uploadedImages` (the form's upload), `keyValueStore` with optional `recordKeys`, and
`datasetId` with optional `datasetFields` (dotted paths such as `images.url`; empty takes every image-like link, and from
Bulk Image Downloader's rows only the stored copy).

### Output

```json
{
    "item": 1,
    "inputType": "link",
    "input": "https://upload.wikimedia.org/wikipedia/commons/e/e1/FullMoon2010.jpg",
    "status": "ok",
    "reason": null,
    "originalFileName": "FullMoon2010.jpg",
    "originalFormat": "jpeg",
    "originalWidth": 2580,
    "originalHeight": 2452,
    "originalBytes": 2143958,
    "fileName": "FullMoon2010.webp",
    "format": "webp",
    "width": 2580,
    "height": 2452,
    "bytes": 486330,
    "savedBytes": 1657628,
    "savingsPercent": 77.3,
    "quality": 80,
    "lossless": false,
    "targetBytes": null,
    "targetMet": null,
    "resized": false,
    "rotated": false,
    "metadata": "strip",
    "frames": 1,
    "sha256": "f884b5948f215d0fe0e64130a93b82e66e5f700c309847b5e3b146acc932bc6e",
    "key": "converted-0001-FullMoon2010.webp",
    "fileUrl": "https://api.apify.com/v2/key-value-stores/…/records/converted-0001-FullMoon2010.webp?signature=…",
    "chargedEvent": "photo",
    "convertedAt": "2026-11-19T12:00:00.000Z"
}
```

### Output fields

| Field | What it is |
|---|---|
| `status` | `ok`, or why there is no image: `invalid`, `refused`, `unreachable`, `not_image`, `unsupported`, `corrupt`, `too_large`, `failed` (free rows) |
| `reason` | Why it was not converted; on a converted image, anything to know (quality lowered for the target, frames dropped) |
| `fileUrl` | The new image's public link (signed: opens without a login) |
| `fileName`, `format`, `width`, `height`, `bytes` | The new image: its file name, format, size in pixels and bytes |
| `originalFormat`, `originalWidth`, `originalHeight`, `originalBytes`, `originalFileName` | The image given (width and height as shown, after its EXIF orientation) |
| `savedBytes`, `savingsPercent` | Bytes saved against the original (negative when the new file is larger) |
| `quality`, `lossless` | How it was encoded |
| `targetBytes`, `targetMet` | The most bytes asked for, and whether the file fits |
| `resized`, `rotated`, `metadata`, `frames` | What was done |
| `sha256`, `key` | The new file's hash and its record in the run's key-value store |
| `input`, `inputType`, `item`, `sourceItemIndex`, `sourceField` | Where the image came from |
| `convertedAt` | When the row was made (UTC, ISO 8601) |
| `chargedEvent` | `image`, `photo` or `large-image` (by the source's pixels), or null for a free row |

### Pricing

Pay per event, no start fee, no monthly rent. Each image is charged by its size in pixels — the work of decoding and
encoding it — never by its file size:

- **US$0.001 per web image**, up to 2048 × 2048 pixels (4.2 megapixels): product photos, page images, screenshots up to
  1440p (`image`).
- **US$0.003 per photo**, up to 24 megapixels (6000 × 4000): phone and camera photos, iPhone HEIC included (`photo`).
- **US$0.008 per large image**, over 24 megapixels: 48 MP phone shots, scans, posters, panoramas (`large-image`).
- An animation kept moving (WebP or GIF output) counts the pixels of every frame.
- **Free**: anything that gives no image — a dead link, a web page, a file that is not an image, a corrupt or unsupported
  file, one over 100 MB. Each is a row saying why.

1,000 web images cost US$1; 1,000 phone photos US$3. The run stops cleanly at your spending limit.

### Memory, speed and limits

- Default memory is 1 GB: a 12-megapixel phone photo converts to any format, AVIF included. Converting a 24 MP or larger
  photo to AVIF at full size needs 2 GB: such an image becomes a free row naming the memory to use, or set a longest
  side. WebP, JPEG and PNG fit far larger images in 1 GB.
- Conversions run one at a time (downloads and uploads overlap), so a large photo always has the memory to itself.
- Up to 100 MB per image, up to 100,000 images per run (`maxImages`, 1,000 by default). WebP allows at most
  16,383 pixels on a side.
- Animation is kept for WebP and GIF output; AVIF, JPEG and PNG take the first frame (the row says so).
- BMP, ICO, PSD, JPEG XL, JPEG 2000 and camera raw files are not converted (free `unsupported` rows).
- From a HEIC, the container's own rotation is always applied.

### FAQ

**Is it a WebP converter, a PNG to JPG converter, a HEIC to JPG converter?** All of them: any of the input formats to any
of WebP, AVIF, JPEG and PNG, in one run.

**How do I get all images at once?** `SUMMARY.zipUrl` in the run's key-value store is a ZIP of every converted image;
the "zip" link in the run's Output tab gives the same.

**Can I use it from my code?** Yes: run it through the Apify API or a client library (JavaScript, Python) and read the
dataset as JSON, CSV or Excel.

### Privacy and legal note

This Actor converts **your own images**: it downloads only the links you give, from public addresses (never private or
local networks), and does not download from social platforms. Images stay in your run's storage, under your account's
data retention. You are responsible for having the right to process the images you give.

Not affiliated with Google, Dropbox or Apple. Built on [sharp](https://sharp.pixelplumbing.com/) (Apache-2.0) and libvips (LGPL-3.0),
and HEIC decoding by [libheif](https://github.com/strukturag/libheif) (LGPL-3.0) through
[heic-decode](https://github.com/catdad-experiments/heic-decode), used unmodified as libraries.

# Actor input Schema

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

Links to your own images: JPG, PNG, WebP, AVIF, GIF (animated too), TIFF, SVG or iPhone HEIC/HEIF, up to 100 MB each. Google Drive and Dropbox share links (shared with anyone with the link) and signed links of Apify key-value records work as they are. A link to a web page instead of an image, and links to Instagram, Facebook, X, Pinterest and other social platforms, are free rows that say why.

## `uploadedImages` (type: `array`):

Images from your computer or phone (HEIC photos included), converted the same way as the links above.

## `keyValueStore` (type: `string`):

Pick a key-value store whose records are images (another Actor's screenshots or downloads). Picking it here is what lets this run read it.

## `recordKeys` (type: `array`):

The keys of the records to convert. Leave empty to convert every record of the store (its INPUT, OUTPUT, SUMMARY and .json/.txt/.html records are left out).

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

Pick the dataset of another run: Bulk Image Downloader's output, a product or listing scraper with image links. Only the dataset you pick here can be read.

## `datasetFields` (type: `array`):

The fields that hold the image links, as dotted paths (images.url takes the url of every element of images). Leave empty to take every link in a field named like image, photo, picture, gallery, cover or banner, or ending in .jpg, .png, .webp, .heic and the like (thumbnails and icons left out). From Bulk Image Downloader's rows only the stored copy (fileUrl) is taken.

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

WebP: about 30 % smaller than JPEG at the same look, shown by every browser. AVIF: smaller still (about half of JPEG), slower to make. JPEG: opens anywhere, also on old software. PNG: lossless, for screenshots, logos and transparency. Keep the format: compress each image in its own format (a HEIC becomes a JPEG, an SVG a PNG).

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

Lower is smaller and blurrier. Leave empty for each format's default: WebP 80, AVIF 50 (looks like JPEG 80), JPEG 80. For PNG, a quality turns it into a palette image of up to 256 colours, much smaller (like TinyPNG); empty keeps PNG lossless.

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

Every pixel kept exactly: best for screenshots, logos and graphics, larger for photos. JPEG has no lossless mode; PNG is always lossless unless a quality is given.

## `maxFileSizeKb` (type: `integer`):

A target size for upload forms and page-speed budgets: the quality is lowered (not below 30) until the image fits, then the image is made smaller. Each row says the quality and size it took (targetMet). Leave empty for no target.

## `longestSide` (type: `integer`):

Resize so that neither side is longer than this, keeping the proportions: 1920 for full-screen web images, 1200 for blog and product images, 400 for thumbnails. Use this or width/height below, not both.

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

Alone, the height follows the proportions. With a height, the fit below decides.

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

Alone, the width follows the proportions.

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

Inside: the whole picture within the box, proportions kept. Cover: fills the box exactly and crops what overflows (square thumbnails). Contain: the whole picture in the exact box, padded with the background (transparent where the format allows). Fill: stretched to the box.

## `enlarge` (type: `boolean`):

Off: an image smaller than the size asked for keeps its size, since enlarging adds no detail. SVGs are always drawn at the size asked for.

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

As #rrggbb. Fills transparency when converting to JPEG (white when empty) and the padding of Contain (transparent when empty, for WebP, AVIF and PNG).

## `autoRotate` (type: `boolean`):

Turn phone and camera photos upright from their EXIF orientation, so they show the right way everywhere, also after the metadata is stripped.

## `metadata` (type: `string`):

Strip: no EXIF (camera, GPS location, date), no colour profile; colours are converted to sRGB first, so they look the same. Keep colour profile: drop EXIF and GPS, keep the ICC profile (wide-gamut iPhone photos keep their colours). Keep all: EXIF, GPS, XMP and the profile, also from HEIC.

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

Links past this number are left (counted in the run's SUMMARY).

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

Images downloaded and stored at the same time; conversions themselves run one after another, so a large photo always has the run's memory to itself.

## Actor input object example

```json
{
  "imageUrls": [
    "https://upload.wikimedia.org/wikipedia/commons/e/e1/FullMoon2010.jpg"
  ],
  "format": "webp",
  "lossless": false,
  "fit": "inside",
  "enlarge": false,
  "autoRotate": true,
  "metadata": "strip",
  "maxImages": 1000,
  "maxConcurrency": 3
}
```

# Actor output Schema

## `images` (type: `string`):

No description

## `zip` (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": [
        "https://upload.wikimedia.org/wikipedia/commons/e/e1/FullMoon2010.jpg"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("steadyscrape/image-converter-compressor").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/e/e1/FullMoon2010.jpg"] }

# Run the Actor and wait for it to finish
run = client.actor("steadyscrape/image-converter-compressor").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/e/e1/FullMoon2010.jpg"
  ]
}' |
apify call steadyscrape/image-converter-compressor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,steadyscrape/image-converter-compressor"
        }
    }
}
```

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/r4X2OEtEAsTqKpU6m/builds/X5r3kQhNmwe4yBd5V/openapi.json
