# Convert images to WebP and compress them

**Use case:** 

Converts JPEG, PNG, GIF and TIFF images to WebP at quality 80, shrinks them to at most 1920 px wide and removes GPS and other EXIF data. Each row shows the bytes saved, and the OUTPUT record has one ZIP link. This example converts two NASA photos and a TIFF scan.

## Input

```json
{
  "images": [
    "https://images-assets.nasa.gov/image/as11-40-5903/as11-40-5903~orig.jpg",
    "https://images-assets.nasa.gov/image/as11-37-5505/as11-37-5505~small.jpg",
    "https://raw.githubusercontent.com/tesseract-ocr/test/main/testing/phototest.tif"
  ],
  "imageFields": [
    "url"
  ],
  "format": "webp",
  "quality": 80,
  "maxKb": 0,
  "maxWidth": 1920,
  "maxHeight": 0,
  "fit": "inside",
  "stripMetadata": true,
  "keepAnimation": true,
  "lossless": false,
  "background": "#ffffff",
  "maxImages": 1000,
  "maxFileSizeMb": 50,
  "timeoutSecs": 120,
  "maxConcurrency": 4
}
```

## Output

```json
{
  "imageIndex": {
    "label": "#",
    "format": "number"
  },
  "url": {
    "label": "Source",
    "format": "link"
  },
  "status": {
    "label": "Status",
    "format": "text"
  },
  "fileUrl": {
    "label": "Converted file",
    "format": "link"
  },
  "format": {
    "label": "Format",
    "format": "text"
  },
  "width": {
    "label": "Width",
    "format": "number"
  },
  "height": {
    "label": "Height",
    "format": "number"
  },
  "bytes": {
    "label": "Bytes",
    "format": "number"
  },
  "sourceBytes": {
    "label": "Source bytes",
    "format": "number"
  },
  "savedPercent": {
    "label": "Saved %",
    "format": "number"
  },
  "variant": {
    "label": "Width asked",
    "format": "number"
  },
  "note": {
    "label": "Note",
    "format": "text"
  },
  "billable": {
    "label": "Billable",
    "format": "boolean"
  },
  "error": {
    "label": "Error",
    "format": "text"
  }
}
```

## How it works

### 1. Sign up on Apify or log in

The Image Converter & Compressor: WebP, AVIF, JPEG, PNG in Bulk Actor is ready to run with the inputs already set for "Convert images to WebP and compress them". [Sign up or log in](https://console.apify.com/create-task-from-example/aLDgeTrZeU1zm1AyR) and you'll land in Apify Console with a copy of this exact task.

### 2. Start the "Convert images to WebP and compress them" task

The Image Converter & Compressor: WebP, AVIF, JPEG, PNG in Bulk Actor will start running based on the input automatically. You can also change all the input fields, like images, image link fields, and more, to match your specific use case.

### 3. Receive the "Convert images to WebP and compress them" output

Monitor the progress in real time. You will be notified as soon as your dataset is complete and ready for review. Each result includes data such as #, source, status, and more.

### 4. Integrate into your workflow

The final output is delivered in JSON, CSV, or Excel format, ready to be plugged into your workflow. You can also [run the "Convert images to WebP and compress them" task via API](https://apify.com/klarto/image-converter.md).

## FAQ

### How much smaller do the WebP files get?

It depends on the source. In the WebP converter task the 3.2 MB NASA photo became 1.7 MB at full size (46.8 % smaller); shrinking to 1920 px saves more. Each row shows savedPercent.

### Is the GPS location removed by the WebP converter?

Yes. The WebP converter task removes EXIF and XMP data, including GPS, after turning the photo upright. The color profile is kept.

### What does the WebP converter cost?

The WebP converter task charges $0.002 per converted image up to 16 megapixels, plus $0.002 per further started 16 MP. Failed and unsupported images are free.

## About this Actor

This example demonstrates how to use [Image Converter & Compressor: WebP, AVIF, JPEG, PNG in Bulk](https://apify.com/klarto/image-converter.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/klarto/image-converter.md) to learn more, explore other use cases, and run it yourself.


## How to integrate an Actor?

This Task's input is already configured above. Use it as-is rather than inventing a new one.

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 full API examples (JavaScript, Python, CLI, MCP, OpenAPI), see this Task's Actor page: https://apify.com/klarto/image-converter.md

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`).
