# Image format converter JPG PNG WEBP (`akash9078/image-format-converter`) Actor

Effortlessly convert and optimize images between formats like JPEG, PNG, WebP, AVIF, and more. Maintain high quality while reducing file size for faster websites, stunning social media visuals, and print-ready graphics.

- **URL**: https://apify.com/akash9078/image-format-converter.md
- **Developed by:** [Akash Kumar Naik](https://apify.com/akash9078) (community)
- **Categories:** Developer tools, Other, Automation
- **Features:** Limited permissions
- **Stats:** 51 total users, 3 monthly users, 97.0% runs succeeded, 3 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.00005 / actor start

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 Format Converter is an Apify Actor that converts images between **JPEG, PNG, WebP, AVIF, GIF, TIFF, BMP, and HEIF** with quality control and compression optimization. Point it at any public image URL and get a converted, optimized file back — built for **web optimization, batch processing, and automated image pipelines** for web developers, photographers, and e-commerce platforms.

### What Is Image Format Converter?

Image Format Converter processes images from any public URL — including Google Drive links — and converts them to your target format with adjustable quality (1-100) and automatic compression reporting. Every conversion reports the original and converted file sizes so you can measure savings, and results are stored in the Apify Key-Value Store with a direct download URL in the dataset.

### Key Features

| Feature | Description |
|---------|-------------|
| **8+ Output Formats** | JPEG, PNG, WebP, AVIF, GIF, TIFF, BMP, HEIF |
| **Quality Control** | Adjustable quality (1-100) for lossy and lossless formats |
| **Compression Optimization** | Automatic ratio reporting and size optimization |
| **Google Drive Support** | Convert images from Google Drive files, Docs, Sheets, Slides |
| **Format Detection** | Automatic input format detection from MIME type and URL |
| **Retry Logic** | Built-in retry with exponential backoff for failed downloads |
| **Dimension Limits** | Supports images up to 10,000 x 10,000 pixels |
| **Size Limits** | Handles files up to 50MB |

### Supported Formats

| Format | Best Use Case | Lossy/Lossless | Compression |
|--------|---------------|----------------|-------------|
| **WebP** | Web images, modern browsers | Both | Excellent |
| **AVIF** | Next-generation web, best compression | Both | Superior |
| **JPEG** | Photographs, universal compatibility | Lossy | Good |
| **PNG** | Transparency, logos, graphics | Lossless | Medium |
| **GIF** | Animated images | Lossless | Low |
| **TIFF** | Archival, print quality | Both | Variable |
| **BMP** | Uncompressed bitmap | Lossless | None |
| **HEIF** | Apple ecosystem, high efficiency | Both | Excellent |

### Use Cases

- **Web optimization** — convert images to WebP or AVIF for faster page loads and reduced bandwidth
- **E-commerce** — standardize product images to consistent formats across catalogs
- **Digital asset management** — batch convert and optimize large image libraries
- **Content marketing** — prepare images for blogs, social media, and publishing platforms
- **Photography workflows** — convert RAW and high-quality formats for web delivery

### Input Parameters

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `imageUrl` | string | Yes | — | Public URL of image to convert (max 50MB, max 10,000×10,000px). Supports direct image URLs and Google Drive links |
| `outputFormat` | string | Yes | `webp` | Target format: `jpeg`, `png`, `webp`, `gif`, `avif`, `tiff`, `bmp`, `heif` |
| `quality` | integer | No | `85` | Quality 1-100. For lossy formats (JPEG, WebP, AVIF), 80-90 is optimal for web; recommended 85 for web optimization |

Example input:

```json
{
  "imageUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/4/47/PNG_transparency_demonstration_1.png/640px-PNG_transparency_demonstration_1.png",
  "outputFormat": "webp",
  "quality": 85
}
```

### Sample Output

Each conversion produces a result object with the following fields:

| Field | Type | Description |
|-------|------|-------------|
| `originalUrl` | string | Source image URL |
| `outputUrl` | string | Converted image URL in Key-Value Store |
| `originalFilename` | string | Original file name |
| `outputFilename` | string | Converted file name |
| `originalFormat` | string | Detected input format (e.g., "JPEG") |
| `targetFormat` | string | Output format (e.g., "WEBP") |
| `originalSize` | integer | Original file size in bytes |
| `convertedSize` | integer | Converted file size in bytes |
| `compressionRatio` | string | Percentage size change (e.g., "25.00%") |
| `compressionSavings` | string | Human-readable savings (e.g., "0.59MB saved") |
| `status` | string | `success` or `error` |
| `processingTime` | integer | Processing time in milliseconds |
| `error` | string | Error message if conversion failed |

Example output (success):

```json
{
  "originalUrl": "https://example.com/photo.jpg",
  "originalFilename": "photo.jpg",
  "originalFormat": "JPEG",
  "targetFormat": "WEBP",
  "originalSize": 2457600,
  "convertedSize": 1843200,
  "compressionRatio": "25.00%",
  "compressionSavings": "0.59MB saved",
  "outputUrl": "https://api.apify.com/v2/key-value-stores/abc123/records/photo.webp",
  "outputFilename": "photo.webp",
  "status": "success",
  "processingTime": 1250
}
```

### How to Use Image Format Converter

1. Open the [Actor page on Apify Store](https://apify.com/akash9078/image-format-converter).
2. Provide the public URL of the image you want to convert.
3. Select the output format — **WebP** is recommended for web optimization.
4. Optionally set quality (1-100; default 85, optimal for web delivery).
5. Run the Actor and download the converted file from the `outputUrl` in the dataset.

#### Connect via API

cURL:

```bash
curl -X POST "https://api.apify.com/v2/acts/akash9078/image-format-converter/runs" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"imageUrl": "https://example.com/image.png", "outputFormat": "webp", "quality": 90}'
```

Python with the [Apify Client](https://docs.apify.com/api/client/python):

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_API_TOKEN")

run = client.actor("akash9078/image-format-converter").call(
    run_input={
        "imageUrl": "https://example.com/image.png",
        "outputFormat": "webp",
        "quality": 90,
    }
)

items = client.dataset(run["defaultDatasetId"]).list_items().items
print(items)
```

Node.js with the [Apify Client](https://docs.apify.com/api/client/js):

```javascript
const { ApifyClient } = require('apify-client');

const client = new ApifyClient({ token: 'YOUR_API_TOKEN' });

const run = await client.actor('akash9078/image-format-converter').call({
    imageUrl: 'https://example.com/image.png',
    outputFormat: 'webp',
    quality: 90,
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

### Error Responses

```json
{
  "originalUrl": "https://example.com/broken-image.jpg",
  "status": "error",
  "error": "Failed to download image after 4 attempts: 404 Not Found",
  "processingTime": 0
}
```

### Technical Specifications

| Specification | Value |
|--------------|-------|
| Maximum file size | 50 MB |
| Maximum dimensions | 10,000 × 10,000 pixels |
| Memory allocation | 128 MB – 256 MB |
| Timeout | 300 seconds |
| Retry attempts | 3 (exponential backoff) |

### Pricing

**Pay-per-event (PPE)** pricing model — you only pay for successful conversions.

| Event | Price | Description |
|-------|-------|-------------|
| `image-converted` | $0.01 | Successfully converted image |
| `image-download-failed` | $0.001 | Failed download attempt |

Estimated cost: 1 image = $0.01, 100 images = $1.00, 1,000 images = $10.00, 10,000 images = $100.00.

Set a maximum spending limit per run in Apify Console. The Actor automatically stops when the limit is reached.

### Why Use Image Format Converter Instead of Manual Conversion?

Manual desktop conversion does not scale: renaming, quality settings, and size reporting must be redone for every file, and nothing can be triggered by an API. Image Format Converter runs in the cloud with automatic format detection, retry logic, compression reporting, and a JSON dataset you can wire into build pipelines, DAM systems, and product feeds — no infrastructure to manage.

### Limitations

- Output to BMP format converts to PNG due to Sharp library constraints
- Google Drive integration exports Docs/Sheets/Slides as PDF
- This Actor processes one image per run; for batch processing, use the Apify API to trigger multiple runs programmatically

### FAQ

#### Which format should I use for web images?

WebP offers the best balance of compression and compatibility. AVIF provides superior compression but has limited browser support.

#### What quality setting should I use?

80-90 is optimal for web images, balancing quality and file size. Use 95-100 for high-quality archival purposes.

#### Does the Actor charge for failed conversions?

Yes, a reduced fee ($0.001) applies for download failures to cover processing costs.

#### Can I convert multiple images in one run?

This Actor processes one image per run. For batch processing, use the Apify API to trigger multiple runs programmatically.

#### Does this support Google Drive images?

Yes, paste a Google Drive share link and the Actor will automatically convert it for download.

### Related Actors

If you need more image and document processing from Apify, check out my other [Apify Actors](https://apify.com/akash9078):

- [Image and PDF Converter](https://apify.com/akash9078/image-pdf-converter)
- [PDF Text Extractor](https://apify.com/akash9078/pdf-text-extractor)
- [Frame Image Converter](https://apify.com/akash9078/frame-image-converter)

***

Built and maintained by [akash9078](https://apify.com/akash9078) on the [Apify platform](https://docs.apify.com).

# Actor input Schema

## `imageUrl` (type: `string`):

Enter the URL of the image you want to convert. Supports direct image URLs from any public web server. Also supports Google Drive links (files, Docs, Sheets, Slides, Drawings exported as PDF/PNG). Maximum file size: 50MB. Maximum dimensions: 10,000x10,000 pixels.

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

Select the target format for your converted image. <strong>WebP</strong> and <strong>AVIF</strong> offer superior compression for web and responsive images. <strong>JPEG</strong> ideal for photographs. <strong>PNG</strong> preserves transparency. <strong>GIF</strong> supports animation.

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

Set output quality from 1-100. Higher values mean better quality but larger files. For lossy formats (JPEG, WebP, AVIF), 80-90 is optimal for web. For lossless formats (PNG, TIFF), this affects compression level. Recommended: 85 for web optimization.

## Actor input object example

```json
{
  "imageUrl": "https://picsum.photos/800/600",
  "outputFormat": "webp",
  "quality": 85
}
```

# Actor output Schema

## `convertedImages` (type: `string`):

Link to the converted image files stored in the key-value store

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

Link to the dataset containing detailed conversion results for each processed image

# 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 = {
    "imageUrl": "https://picsum.photos/800/600"
};

// Run the Actor and wait for it to finish
const run = await client.actor("akash9078/image-format-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 = { "imageUrl": "https://picsum.photos/800/600" }

# Run the Actor and wait for it to finish
run = client.actor("akash9078/image-format-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 '{
  "imageUrl": "https://picsum.photos/800/600"
}' |
apify call akash9078/image-format-converter --silent --output-dataset

```

## MCP server setup

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