# Image Compressor & Converter: WebP, AVIF, JPEG, PNG, HEIC (`manageable_gully/image-compressor-converter`) Actor

Bulk image compression and conversion: compress JPEG/PNG, convert to WebP or AVIF, HEIC to JPG, resize, hit a target file size and strip EXIF/GPS metadata. Download links per image plus an optional ZIP. $1 per 1,000 images, failed images free.

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

## Pricing

from $1.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 Compressor & Converter: Bulk WebP, AVIF, JPEG, PNG & HEIC to JPG

**Compress and convert images in bulk**: shrink JPEG and PNG files, convert to **WebP** or **AVIF** for a faster website, turn iPhone **HEIC photos into JPG**, **resize** to a maximum width or height, hit a **target file size** (e.g. "under 200 KB") and **strip EXIF metadata including the GPS location** from photos. Paste image links (or upload a file), click Start, and get one result row per image with the old and new size, the savings in percent and a **direct download link**, plus an optional **ZIP of all images**. No API key, no software to install. **$1 per 1,000 images**, and failed images are free.

### What you can use it for

- **Faster websites and better Core Web Vitals:** convert product photos and blog images to WebP or AVIF and cut page weight by 70-95%.
- **E-commerce catalogs:** resize and compress thousands of Shopify, WooCommerce or marketplace product images in one run, with a white background for transparent PNGs.
- **Upload limits:** make every file fit a size limit (job portals, forms, CMS, email attachments) with the target file size option.
- **iPhone photos (HEIC) to JPG** for Windows, older apps and websites that don't accept HEIC.
- **Privacy:** remove the GPS location and camera data from photos before you publish or share them.
- **Animated GIF to WebP:** keep the animation at a fraction of the size.
- **Automation:** call it from n8n, Make, Zapier, your CMS or an AI agent after every upload.

### How to use it

1. Paste direct image links in **Image links** (one per line, or import a text/CSV file) or **upload an image**. Google Drive ("Anyone with the link") and Dropbox share links work.
2. Pick the **output format** (WebP, AVIF, JPEG, PNG or keep the original format) and the **quality** (80 is a good default).
3. Optional: set a **max width/height**, a **target max file size**, what **metadata** to remove, and whether you want a **ZIP**.
4. Click **Start**. Each image becomes one row in the results with a `downloadUrl`. The ZIP link is in the `OUTPUT` record and in the run log.

### Pricing

You pay **$0.001 per image** ($1 per 1,000), plus $0.0005 when a run starts. An image is any picture up to 25 megapixels, which covers every phone and most camera photos. Bigger images and animations count per started 25 megapixels (an animated GIF counts all its frames). **Images that fail, are refused or are skipped are free, and so is the ZIP.**

| Job | Images | Price |
|---|---|---|
| Try it on one photo | 1 | **$0.0015** |
| 100 product photos to WebP | 100 | **$0.10** |
| 1,000 blog images resized to 1600 px | 1,000 | **$1.00** |
| 10,000 catalog images to AVIF | 10,000 | **$10.00** |
| A 48 MP camera photo | 1 (2 x 25 MP) | **$0.002** |

That's half of what most comparable Store Actors charge ($2-$10 per 1,000), and unlike online compressor web apps there is no monthly plan, no 20-files-at-a-time limit and no manual uploading.

### Features

- **Formats in:** JPEG, PNG, WebP, AVIF, **HEIC/HEIF** (iPhone), GIF (incl. animated), TIFF, BMP. **Formats out:** WebP, AVIF, JPEG, PNG, or keep the original format.
- **Smart compression:** optimized progressive JPEG, WebP and AVIF at the quality you choose; optional lossless WebP/AVIF; optional **TinyPNG-style PNG color reduction** (256 colors with dithering, usually 50-80% smaller).
- **Target file size:** finds the highest quality that fits your limit and, if needed, scales the image down until it fits.
- **Resize** to a max width and/or height, keeping the aspect ratio. Images are never enlarged.
- **Metadata & privacy:** removes all EXIF/XMP metadata incl. **GPS location** by default, or only the GPS data, or nothing. The camera rotation is applied to the pixels first, so photos never end up sideways. The color profile (e.g. iPhone Display P3) is kept so colors stay right.
- **Transparency:** kept for WebP, AVIF and PNG; filled with your background color for JPEG.
- **Animations:** animated GIF/WebP/PNG stay animated in WebP, AVIF, GIF and PNG output.
- **Never worse:** if re-encoding would make an already optimized file bigger (same format and size, no metadata to remove), the original is returned instead.
- **Safe:** only the links you give are downloaded; web pages, private network addresses, SVG and PDF files are refused with a clear message. Max 50 MB and 100 megapixels per image, up to 5,000 images per run.
- **Budget safe:** before each image it checks your run's max cost and skips images that would exceed it (not charged).

### Input example

```json
{
  "imageUrls": [
    {"url": "https://upload.wikimedia.org/wikipedia/commons/5/5c/Kennedy_will_be_one_of_Eglinton_Crosstown_LRT_stations%2C_GPS_embedded%2C_taken_2013_04_25_%281%29.JPG"},
    {"url": "https://upload.wikimedia.org/wikipedia/commons/2/2c/Rotating_earth_%28large%29.gif"}
  ],
  "outputFormat": "webp",
  "quality": 80,
  "maxWidth": 2560,
  "stripMetadata": "all",
  "createZip": true
}
```

### Output example (one item per image)

A real result: a 14-megapixel public-domain photo with GPS data, converted to WebP at 2560 px wide. 5.4 MB became 160 KB.

```json
{
  "url": "https://upload.wikimedia.org/wikipedia/commons/5/5c/Kennedy_will_be_one_of_Eglinton_Crosstown_LRT_stations%2C_GPS_embedded%2C_taken_2013_04_25_%281%29.JPG",
  "position": 1,
  "megapixels": 14.0,
  "fileName": "Kennedy_will_be_one_of_Eglinton_Crosstown_LRT_stations-_GPS_embedded-_taken_2013.webp",
  "inputFormat": "jpeg",
  "outputFormat": "webp",
  "originalBytes": 5385216,
  "outputBytes": 159902,
  "savedBytes": 5225314,
  "savingsPercent": 97.0,
  "originalWidth": 4320,
  "originalHeight": 3240,
  "width": 2560,
  "height": 1920,
  "frames": 1,
  "quality": 80,
  "metadataRemoved": ["gps", "exif"],
  "gpsRemoved": true,
  "downloadUrl": "https://api.apify.com/v2/key-value-stores/<store-id>/records/Kennedy_will_be_one_of_Eglinton_Crosstown_LRT_stations-_GPS_embedded-_taken_2013.webp?signature=...",
  "processingSeconds": 0.86,
  "billedUnits": 1
}
```

In the same run, the 44-frame animated "Rotating earth" GIF went from 1.0 MB to 288 KB as an animated WebP (-71%), and a transparent PNG from 225 KB to 69 KB (-69%) with its transparency kept. The run summary (`OUTPUT` record):

```json
{"images": 7, "processed": 4, "failed": 3, "skipped": 0, "originalBytes": 6620522, "outputBytes": 520168,
 "savedBytes": 6100354, "savingsPercent": 92.1, "billedUnits": 4, "zipUrl": "https://api.apify.com/v2/key-value-stores/<store-id>/records/images.zip?signature=..."}
```

The 3 failed rows were a web page, a 404 link and a private network address. They each got a clear `error` message and were not charged.

### Use it from code, n8n or AI agents

Call it through the Apify API (`POST https://api.apify.com/v2/acts/manageable_gully~image-compressor-converter/run-sync-get-dataset-items`), the Apify Python/JavaScript clients, the Apify n8n/Make/Zapier integrations, or as a tool for AI agents through the Apify MCP server. Every `downloadUrl` is a direct link you can save to S3, Google Drive or your CMS.

### FAQ

**WebP or AVIF?** WebP works in every current browser and is fast to encode. AVIF is usually 10-30% smaller again at the same look, and is supported by all modern browsers. If you are not sure, use WebP.

**Which quality should I use?** 75-85 looks like the original for almost all photos. Use 60-70 for thumbnails. For AVIF the same number gives a similar look (it is mapped to AVIF's own scale).

**Will my images lose quality?** JPEG, WebP and AVIF are lossy, but at 80 the difference is not visible for normal viewing. Use lossless WebP/AVIF or PNG for pixel-perfect output.

**Do you keep my images?** Converted files are stored only in your own Apify run storage (your account's data retention applies). Nothing is sent to third-party services.

**Can it download all images from a web page?** No. It only processes the image links you give it. To collect the image links of your own site, run [Broken Link Checker](https://apify.com/manageable_gully/broken-link-checker) with "include working links" on: it lists every image URL it checks.

**Can it convert SVG or PDF?** No. For PDFs and scanned images to text use [PDF & Image OCR Extractor](https://apify.com/manageable_gully/pdf-ocr-extractor).

**How big can images be?** Up to 50 MB and 100 megapixels per image (raise `maxMegapixels` to 150 and give the run 2 GB of memory for huge panoramas), up to 5,000 images per run.

### More tools from WebIntel Tools

- [Website Screenshot & URL to PDF](https://apify.com/manageable_gully/url-to-pdf-screenshot)
- [PDF & Image OCR to Text/Markdown](https://apify.com/manageable_gully/pdf-ocr-extractor)
- [Lighthouse & PageSpeed Bulk Audit](https://apify.com/manageable_gully/lighthouse-bulk-audit)
- [Broken Link Checker](https://apify.com/manageable_gully/broken-link-checker)
- [Web Page to Markdown for LLMs](https://apify.com/manageable_gully/page-to-markdown)

# Actor input Schema

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

Direct links to image files: JPEG, PNG, WebP, AVIF, HEIC/HEIF (iPhone), GIF (incl. animated), TIFF, BMP. Max 50 MB and 100 megapixels each, up to 5,000 per run. Google Drive (shared as 'Anyone with the link') and Dropbox share links work. Web pages are refused: use the image's own address.

## `uploadedFile` (type: `string`):

Upload one image from your computer instead of (or in addition to) links.

## `outputFormat` (type: `string`):

Format of the converted images. 'Keep' compresses in the same format (HEIC, TIFF and BMP become JPEG, or PNG when they have transparency).

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

For JPEG, WebP and AVIF. 75-85 looks the same as the original for most photos; lower = smaller files. Ignored for PNG and lossless output.

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

Shrink images wider than this, keeping the aspect ratio. 0 = keep the original width. Images are never enlarged.

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

Shrink images taller than this, keeping the aspect ratio. 0 = keep the original height.

## `targetMaxSizeKB` (type: `integer`):

Make every file at most this big (e.g. 200 for a 200 KB upload limit). Lowers the quality step by step and, if needed, the resolution. 0 = off.

## `resizeToReachTarget` (type: `boolean`):

If lowering the quality is not enough, scale the image down until it fits the target size.

## `stripMetadata` (type: `string`):

Photos from phones often contain the exact GPS location where they were taken. By default all EXIF and XMP metadata is removed. The camera rotation is always applied to the pixels first, so images never end up sideways.

## `keepColorProfile` (type: `boolean`):

Keeps colors accurate for wide-gamut photos (e.g. iPhone Display P3). Turn off to save a few more KB.

## `pngReduceColors` (type: `boolean`):

Lossy PNG compression: usually 50-80% smaller PNGs with hardly visible change. Best for screenshots, logos and illustrations.

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

Pixel-perfect WebP/AVIF (bigger files). Good for screenshots and graphics.

## `backgroundColor` (type: `string`):

JPEG has no transparency: transparent areas are filled with this hex color.

## `createZip` (type: `boolean`):

Adds images.zip (all converted images, max 300 MB) to the run's key-value store. Free.

## `keepOriginalIfSmaller` (type: `boolean`):

When the format and size stay the same and the original is already smaller (and has no metadata to remove), the original file is returned as is.

## `maxMegapixels` (type: `integer`):

Images above this are skipped (not charged). Above 100 MP give the run 2 GB of memory or more.

## `avifSpeed` (type: `integer`):

Higher = faster, slightly bigger AVIF files. 7 is a good balance.

## Actor input object example

```json
{
  "imageUrls": [
    {
      "url": "https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1280px-Image_created_with_a_mobile_phone.png"
    }
  ],
  "outputFormat": "webp",
  "quality": 80,
  "maxWidth": 0,
  "maxHeight": 0,
  "targetMaxSizeKB": 0,
  "resizeToReachTarget": true,
  "stripMetadata": "all",
  "keepColorProfile": true,
  "pngReduceColors": false,
  "lossless": false,
  "backgroundColor": "#ffffff",
  "createZip": false,
  "keepOriginalIfSmaller": true,
  "maxMegapixels": 100,
  "avifSpeed": 7
}
```

# Actor output Schema

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

One item per image: original and new size, savings %, dimensions, removed metadata and a download link.

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

The compressed/converted images (and images.zip if you asked for a ZIP) in the run's key-value store.

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

Totals for the run: images processed, bytes saved, billed units and the ZIP link.

# 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://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1280px-Image_created_with_a_mobile_phone.png"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("manageable_gully/image-compressor-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://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1280px-Image_created_with_a_mobile_phone.png" }] }

# Run the Actor and wait for it to finish
run = client.actor("manageable_gully/image-compressor-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://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1280px-Image_created_with_a_mobile_phone.png"
    }
  ]
}' |
apify call manageable_gully/image-compressor-converter --silent --output-dataset

```

## MCP server setup

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