# Compress images to AVIF for a faster website

**Use case:** 

Turns JPEG, PNG and WebP images from your Apify key-value store, your uploaded files or direct image links into AVIF, which is usually much smaller than JPEG at the same visual quality. You can also cap the width so that large photos are shrunk for the web. Metadata is removed. Run it as it is to try three built-in sample images, then choose your own images.

## Input

```json
{
  "outputFormat": "avif",
  "quality": 60,
  "maxWidth": 1920,
  "colorProfile": "srgb",
  "keepMetadata": false,
  "pngReduceColors": false
}
```

## Output

```json
{
  "status": {
    "label": "Status",
    "format": "string"
  },
  "inputKey": {
    "label": "Input key",
    "format": "string"
  },
  "linkNumber": {
    "label": "Link number",
    "format": "integer"
  },
  "outputUrl": {
    "label": "Output URL",
    "format": "string"
  },
  "inputFormat": {
    "label": "Input format",
    "format": "string"
  },
  "outputFormat": {
    "label": "Output format",
    "format": "string"
  },
  "inputBytes": {
    "label": "Input size (bytes)",
    "format": "integer"
  },
  "outputBytes": {
    "label": "Output size (bytes)",
    "format": "integer"
  },
  "savedPercent": {
    "label": "Saved (%)",
    "format": "number"
  },
  "inputWidth": {
    "label": "Input width",
    "format": "integer"
  },
  "inputHeight": {
    "label": "Input height",
    "format": "integer"
  },
  "outputWidth": {
    "label": "Output width",
    "format": "integer"
  },
  "outputHeight": {
    "label": "Output height",
    "format": "integer"
  },
  "hadExif": {
    "label": "Had EXIF",
    "format": "boolean"
  },
  "hadGps": {
    "label": "Had GPS location",
    "format": "boolean"
  },
  "hadXmp": {
    "label": "Had XMP",
    "format": "boolean"
  },
  "hadIptc": {
    "label": "Had IPTC",
    "format": "boolean"
  },
  "hadIccProfile": {
    "label": "Had color profile",
    "format": "boolean"
  },
  "hadComments": {
    "label": "Had comments",
    "format": "boolean"
  },
  "rotatedByExif": {
    "label": "Rotated by EXIF",
    "format": "boolean"
  },
  "chargedEvents": {
    "label": "Charged events",
    "format": "integer"
  },
  "errorCode": {
    "label": "Error code",
    "format": "string"
  },
  "errorMessage": {
    "label": "Error message",
    "format": "string"
  }
}
```

## How it works

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

The Image Converter & Compressor - WebP, AVIF, strip EXIF/GPS Actor is ready to run with the inputs already set for "Compress images to AVIF for a faster website". [Sign up or log in](https://console.apify.com/create-task-from-example/bxtJan2dyBcNtB4Wh) and you'll land in Apify Console with a copy of this exact task.

### 2. Start the "Compress images to AVIF for a faster website" task

The Image Converter & Compressor - WebP, AVIF, strip EXIF/GPS Actor will start running based on the input automatically. You can also change all the input fields, like output format, quality, and more, to match your specific use case.

### 3. Receive the "Compress images to AVIF for a faster website" 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 status, input key, link number, 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 "Compress images to AVIF for a faster website" task via API](https://apify.com/quietworkslab/image-converter.md).

## FAQ

### Which quality should I use for AVIF?

As a starting point, AVIF at quality 50 to 65 often looks similar to JPEG at 80 to 85 while being smaller. The AVIF compression task uses 60; compare a few results on your own images and adjust.

### Is AVIF conversion slower than WebP?

Yes. AVIF is slower to encode than WebP, so the Image Converter counts each AVIF output as two image-processed events. With the default 1 GB of memory, AVIF output works up to about 20 megapixels per image.

### Are images enlarged when I set a maximum width?

No. The AVIF compression task only shrinks images wider than the maximum width, keeping the aspect ratio. Smaller images keep their size.

## About this Actor

This example demonstrates how to use [Image Converter & Compressor - WebP, AVIF, strip EXIF/GPS](https://apify.com/quietworkslab/image-converter.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/quietworkslab/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/quietworkslab/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`).
