# Image Collage Grid Maker: Combine Photos into One Grid (`kotaro-project/image-collage-grid-maker`) Actor

Combine images from public URLs into one grid collage. Choose columns, cell size, gap, background colour and how photos fit their cells (cover, contain or stretch), then download JPEG, PNG or WebP. Pay per finished collage; failed runs are not charged.

- **URL**: https://apify.com/kotaro-project/image-collage-grid-maker.md
- **Developed by:** [KOTARO project](https://apify.com/kotaro-project) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 collage createds

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 Collage Grid Maker: Combine Photos into One Grid

Need one picture that shows several products, a mood board or a before-and-after set? Give this tool the image addresses and get a tidy grid collage.

### What it does

- Places your photos in **rows and columns**, in the order you give
- Picks a near-square grid automatically, or uses your **number of columns**
- Sets the **cell size**, the **gap** and the **background colour** (or transparent)
- Lets each photo **cover** its cell, be shown whole (**contain**), or **stretch**
- Saves one **JPEG, PNG or WebP** with a download link

### Input

```json
{
  "imageUrls": ["https://example.com/1.jpg", "https://example.com/2.jpg", "https://example.com/3.jpg"],
  "columns": 3,
  "cellWidth": 400,
  "cellHeight": 400,
  "gap": 12,
  "backgroundColor": "#ffffff",
  "fit": "cover"
}
```

### Output

```json
{
  "outputUrl": "https://api.apify.com/v2/key-value-stores/.../records/collage-1a2b3c.jpg",
  "width": 1248,
  "height": 424,
  "columns": 3,
  "rows": 1,
  "imageCount": 3,
  "skipped": []
}
```

### Notes

- Images that cannot be downloaded or read are skipped and listed in `skipped`; the rest still make the collage.
- Up to 100 images per collage, 30 MB each, and up to 12000 pixels on a side. Only public addresses are accepted.
- The sample input uses NASA photos taken from the International Space Station (public domain, no people).

### Pricing

Pay per finished collage (one per run). Runs that fail are not charged. An empty run returns a free note.

# Actor input Schema

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

Public http(s) addresses of the images, in the order they should appear (left to right, then top to bottom). Up to 100, 30 MB each.

## `columns` (type: `integer`):

Number of columns. 0 makes a grid that is as square as possible.

## `cellWidth` (type: `integer`):

Width of each photo in the grid.

## `cellHeight` (type: `integer`):

Height of each photo in the grid.

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

cover fills the cell and trims the edges; contain shows the whole photo with background around it; stretch changes the shape to fill the cell.

## `gap` (type: `integer`):

Space between the photos and around the edge.

## `backgroundColor` (type: `string`):

Colour of the gaps, for example #ffffff, #111827 or transparent (PNG and WebP only).

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

JPEG is smallest; PNG and WebP keep a transparent background.

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

Higher keeps more detail and makes bigger files.

## Actor input object example

```json
{
  "imageUrls": [
    "https://images-assets.nasa.gov/image/iss073e0532039/iss073e0532039~medium.jpg",
    "https://images-assets.nasa.gov/image/iss067e191368/iss067e191368~medium.jpg",
    "https://images-assets.nasa.gov/image/iss070e027906/iss070e027906~medium.jpg",
    "https://images-assets.nasa.gov/image/iss073e0982217/iss073e0982217~medium.jpg"
  ],
  "columns": 0,
  "cellWidth": 400,
  "cellHeight": 300,
  "fit": "cover",
  "gap": 10,
  "backgroundColor": "#ffffff",
  "format": "jpeg",
  "quality": 90
}
```

# Actor output Schema

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

No description

# 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://images-assets.nasa.gov/image/iss073e0532039/iss073e0532039~medium.jpg",
        "https://images-assets.nasa.gov/image/iss067e191368/iss067e191368~medium.jpg",
        "https://images-assets.nasa.gov/image/iss070e027906/iss070e027906~medium.jpg",
        "https://images-assets.nasa.gov/image/iss073e0982217/iss073e0982217~medium.jpg"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("kotaro-project/image-collage-grid-maker").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://images-assets.nasa.gov/image/iss073e0532039/iss073e0532039~medium.jpg",
        "https://images-assets.nasa.gov/image/iss067e191368/iss067e191368~medium.jpg",
        "https://images-assets.nasa.gov/image/iss070e027906/iss070e027906~medium.jpg",
        "https://images-assets.nasa.gov/image/iss073e0982217/iss073e0982217~medium.jpg",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("kotaro-project/image-collage-grid-maker").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://images-assets.nasa.gov/image/iss073e0532039/iss073e0532039~medium.jpg",
    "https://images-assets.nasa.gov/image/iss067e191368/iss067e191368~medium.jpg",
    "https://images-assets.nasa.gov/image/iss070e027906/iss070e027906~medium.jpg",
    "https://images-assets.nasa.gov/image/iss073e0982217/iss073e0982217~medium.jpg"
  ]
}' |
apify call kotaro-project/image-collage-grid-maker --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,kotaro-project/image-collage-grid-maker"
        }
    }
}
```

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/aZsrzgKAUkEOFVdhH/builds/wzQ1WTHoz3SDOyJfD/openapi.json
