# Compress images to under 100 KB in bulk

**Use case:** 

Compresses images to a size target in KB: the quality is lowered step by step (never below 20) until each JPEG, WebP or AVIF file fits, and photos can be resized at the same time. GPS and other EXIF data are removed, and all files come in one ZIP. $0.002 per image up to 16 MP. This example turns two 3–4 MB NASA photos into 1200 px JPEGs under 100 KB (102,400 bytes).

## 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~orig.jpg"
  ],
  "imageFields": [
    "url"
  ],
  "format": "jpeg",
  "quality": 80,
  "maxKb": 100,
  "maxWidth": 1200,
  "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 "Compress images to under 100 KB in bulk". [Sign up or log in](https://console.apify.com/create-task-from-example/6WPBderbm7JV6Chji) and you'll land in Apify Console with a copy of this exact task.

### 2. Start the "Compress images to under 100 KB in bulk" 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 "Compress images to under 100 KB in bulk" 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 "Compress images to under 100 KB in bulk" task via API](https://apify.com/klarto/image-converter.md).

## FAQ

### What if an image cannot get under 100 KB?

The compress-to-100-KB task then saves it at quality 20 and notes 'could not reach 100 KB even at quality 20' in its row. 1 KB = 1,024 bytes; for a 100,000-byte limit set maxKb to 97. At 1600 px both example photos stayed above 100 KB.

### Which formats work with a KB target?

JPEG, WebP or AVIF output. This task writes JPEG, so PNG sources are compressed too. PNG and lossless WebP output are lossless: the compress-to-100-KB task ignores the size target for them and says so in the row's note.

### What does compressing images cost?

The compress-to-100-KB task charges $0.002 per converted image up to 16 megapixels of output, plus $0.002 per further started 16 MP; PNG or lossless WebP output adds $0.0025 per started 4 MP. Failed and unsupported images are free.

### Is the GPS location removed?

Yes. The compress-to-100-KB task removes EXIF and XMP data, including GPS, after turning the photo upright. The color profile is kept.

### How good is the quality at 100 KB?

It depends on the photo and its size. In this example the compress-to-100-KB task fit the 1200 px JPEGs into 100 KB at quality 25 and 37, shown in each row's quality field. For a higher quality, raise maxKb or lower maxWidth.

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