# Image Converter & Compressor: WebP, AVIF, JPG, PNG, Resize (`tidelane/image-converter`) Actor

Convert and compress images in bulk: to WebP, AVIF, JPEG, PNG, GIF or TIFF, resize and crop, hit a target file size, strip EXIF and GPS data, keep GIF animations. Download each file or one ZIP.

- **URL**: https://apify.com/tidelane/image-converter.md
- **Developed by:** [Tidelane Data](https://apify.com/tidelane) (community)
- **Categories:** Developer tools, Automation
- **Security:** Limited permissions
- **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: WebP, AVIF, JPG, PNG, Resize

Convert, compress and resize **images in bulk**. Give a list of image links and get optimized files back, each with a download link, or all of them in **one ZIP**.

- **Convert** JPEG, PNG, WebP, AVIF, GIF, TIFF and SVG to **WebP, AVIF, JPEG, PNG, GIF or TIFF**

- **Compress** with a quality setting, or set a **maximum file size** and let the Actor find the best quality that fits

- **Resize and crop**: fit within a box, cover (thumbnails), pad, or stretch; never enlarges unless you allow it

- **PNG like TinyPNG**: palette compression with dithering, often 60-80 % smaller

- **Remove EXIF and GPS data** (camera, location) by default, colors converted to sRGB

- **Animated GIFs stay animated** as WebP or GIF

- **SVG** is rendered sharply at the size you ask for

- Photos are **turned upright** using their camera orientation

- ✅ **Fast**: libvips via sharp, several images in parallel

- ✅ **Safe for large photos**: memory is planned per image, so one huge file cannot crash the run

- ✅ **Fair billing**: per converted image; failed downloads are free

### Use cases

- **Faster websites**: turn product photos and blog images into WebP or AVIF (Core Web Vitals, PageSpeed)
- **Shops and marketplaces**: uniform sizes and file limits, for example square 1000 x 1000 px under 300 KB
- **Privacy**: remove GPS locations from photos before publishing
- **Pipelines**: run after a scraper and store web-ready copies

### Input examples

WebP for a website, max 1600 px wide:

```json
{
    "imageUrls": ["https://example.com/photos/hero.jpg", "https://example.com/photos/team.png"],
    "format": "webp",
    "quality": 80,
    "width": 1600,
    "zip": true
}
```

Square product thumbnails, JPEG under 150 KB, white background:

```json
{
    "imageUrls": ["https://example.com/products/1.png"],
    "format": "jpeg",
    "width": 1000,
    "height": 1000,
    "fit": "contain",
    "background": "#ffffff",
    "maxSizeKb": 150
}
```

### Output example

Real output from a test run (`format: webp`, `width: 1200`) with images from Wikimedia Commons: a 14.7 MB, 46-megapixel photo became a 97 KB WebP.

```json
{
    "sourceUrl": "https://upload.wikimedia.org/wikipedia/commons/3/3f/Fronalpstock_big.jpg",
    "status": "ok",
    "fileName": "Fronalpstock_big.webp",
    "outputUrl": "https://api.apify.com/v2/key-value-stores/…/records/Fronalpstock_big.webp",
    "format": "webp",
    "width": 1200,
    "height": 539,
    "quality": 80,
    "originalFormat": "jpeg",
    "originalWidth": 10109,
    "originalHeight": 4542,
    "hadMetadata": true,
    "originalBytes": 14679474,
    "outputBytes": 97212,
    "savedPercent": 99.3,
    "megapixels": 45.9
}
```

In the same run an animated GIF (44 frames, 1.0 MB) became an animated WebP of 244 KB, and a transparent PNG (225 KB) a transparent WebP of 69 KB.

The files are stored in the run's key-value store; `outputUrl` is a direct download link. `OUTPUT` holds the totals (converted, failed, bytes saved) and the ZIP link.

### Pricing

One event per converted image of up to 12 megapixels; larger images count one event per started 12 megapixels (AVIF: per 6 megapixels, it takes longer to encode). Images that fail cost nothing.

Paid Apify plans pay less: 10% off on Starter, 20% on Scale and 30% on Business and higher plans.

### FAQ

**Which format should I choose?** WebP works in all current browsers and is usually 25-35 % smaller than JPEG. AVIF is smaller still but slower to create. JPEG for maximum compatibility, PNG for graphics with sharp edges.

**What quality?** 75-85 for photos. With `maxSizeKb` the Actor lowers the quality (down to 30) and, if needed, the dimensions.

**Very large images?** Up to 100 megapixels. For AVIF above about 15 megapixels run with 4 GB memory, or set a width; the Actor tells you if an image does not fit.

**HEIC from iPhones?** Not supported. Export as JPEG on the phone, or use the "Most compatible" camera setting.

**Can I upload files?** Use links. Files in an Apify key-value store or any public storage (S3, Google Cloud Storage, Dropbox direct links) work.

### More tools from Tidelane Data

- [AI Image Upscaler](https://apify.com/tidelane/ai-image-upscaler): upscale images 2x, 3x or 4x with Real-ESRGAN
- [AI Background Remover](https://apify.com/tidelane/ai-background-remover): transparent PNG or a white background
- [Bulk Image Downloader](https://apify.com/tidelane/bulk-image-downloader): all images from web pages, also as one ZIP
- [Website Screenshot API](https://apify.com/tidelane/website-screenshots): full-page and mobile screenshots without cookie banners

All our tools: [apify.com/tidelane](https://apify.com/tidelane)

***

#### Impressum

Levi Griesinger, Tidelane Data\
Besigheimer Straße 18\
74369, Löchgau, Deutschland\
E-Mail: LeviGriesinger@gmail.com

# Actor input Schema

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

Links to JPEG, PNG, WebP, AVIF, GIF, TIFF or SVG images (up to 50 MB each).

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

WebP: best for websites. AVIF: smallest files, all modern browsers. 'Same as input' only compresses and resizes.

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

1-100. 75-85 looks the same as the original for photos at a fraction of the size. For PNG, below 100 means a palette PNG like TinyPNG; 100 is lossless.

## `maxSizeKb` (type: `integer`):

Optional target: lowers the quality (down to 30), then the dimensions, until each file is at most this size.

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

Resize to this width. With only width or height set, the aspect ratio is kept.

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

Resize to this height.

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

With width and height: inside = fit within the box, cover = fill the box and crop the edges (thumbnails), contain = fit and pad with the background color, fill = stretch.

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

By default smaller images are not scaled up.

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

Pixel-perfect WebP or AVIF, for screenshots and graphics.

## `keepMetadata` (type: `boolean`):

By default EXIF (camera, GPS location), IPTC and XMP data are removed and colors are converted to sRGB.

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

Fills transparent areas when converting to JPEG, and the padding of 'contain'.

## `zip` (type: `boolean`):

Saves all-images.zip in the key-value store; its link is in OUTPUT.

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

Images processed at the same time. Lower it for very large images.

## Actor input object example

```json
{
  "imageUrls": [
    "https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png"
  ],
  "format": "webp",
  "quality": 80,
  "fit": "inside",
  "allowEnlarge": false,
  "lossless": false,
  "keepMetadata": false,
  "background": "#ffffff",
  "zip": false,
  "maxConcurrency": 4
}
```

# Actor output Schema

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

All results of the run as dataset items.

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

Summary per input with status (ok, error and the reason).

# 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/4/47/PNG_transparency_demonstration_1.png"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("tidelane/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/4/47/PNG_transparency_demonstration_1.png"] }

# Run the Actor and wait for it to finish
run = client.actor("tidelane/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/4/47/PNG_transparency_demonstration_1.png"
  ]
}' |
apify call tidelane/image-converter --silent --output-dataset

```

## MCP server setup

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