# Social Media Image Resizer: Instagram, Facebook & LinkedIn (`data-done-right/social-image-resizer`) Actor

Resize images to social media sizes in bulk: image URLs in, Instagram, Facebook, LinkedIn, X, YouTube, Pinterest and OG files out with signed links. Fit by crop, pad or blur-pad. Direct image files only; no face detection, no posting, no web pages.

- **URL**: https://apify.com/data-done-right/social-image-resizer.md
- **Developed by:** [Data Done Right](https://apify.com/data-done-right) (community)
- **Categories:** Developer tools, Social media, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.20 / 1,000 image preset outputs

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## Social Media Image Resizer: Instagram, Facebook & LinkedIn

Use this **social media image resizer** to **resize images for Instagram, Facebook, LinkedIn, X, YouTube, Pinterest and Open Graph** from a list of image URLs. Paste direct image links, tick the sizes you need, and get one exact-size file per image and preset, each with a signed download link. Crop to fill, pad with a color, or pad with a blurred copy of the image.

**What it does NOT do (read this first)**

- It takes **direct links to image files**, not web pages, and it does **not** read, scrape or post to Instagram, Facebook, LinkedIn or any other social platform. Page URLs are reported as failed; links on those platforms' own pages are not supported.
- It does **not** detect faces or subjects. A crop keeps a fixed part of the picture (center, top, bottom, left or right). Check the output when a face is near the edge, or use `contain` or `blur-pad`, which crop nothing.
- No HEIC/HEIF, SVG, PDF or RAW input. Readable inputs: JPEG, PNG, WebP, AVIF, GIF, BMP, TIFF. Output is JPEG, PNG or WebP. Animations keep only their first frame.
- It does not add text, logos, borders or captions, and does not make images sharper. A small image enlarged to a big preset can look soft (the row's `note` says so).
- The preset sizes are the commonly published ones. Platforms change their recommendations; use `customSizes` for any other size.
- It honours the host's **robots.txt** and does not log in, use proxies or work around hotlink protection. A 401, 403 or 429 from the host is reported as failed.
- Images above 64 megapixels and files above your source size limit (25 MB by default, 100 MB at most) are refused.

### What you get

- One dataset row per image and preset: signed download link, exact `width` and `height`, format, bytes, `fit`, `status` and a plain-language `note`.
- The files in the run's key-value store (kept as long as the run's storage is kept).
- A `SUMMARY` record with totals, and a `FAILED` record that lists every image that failed and why.

### Presets

| Preset key | Size (px) | Use |
|---|---|---|
| `instagram-square` | 1080 x 1080 | Instagram post, 1:1 |
| `instagram-portrait` | 1080 x 1350 | Instagram post, 4:5 |
| `instagram-landscape` | 1080 x 566 | Instagram post, 1.91:1 |
| `instagram-story` | 1080 x 1920 | Instagram Story or Reel, 9:16 |
| `facebook-post` | 1200 x 630 | Facebook link or image post |
| `facebook-cover` | 820 x 312 | Facebook page cover photo |
| `linkedin-post` | 1200 x 627 | LinkedIn post or link image |
| `linkedin-cover` | 1584 x 396 | LinkedIn profile banner, 4:1 |
| `x-post` | 1600 x 900 | X (Twitter) post image, 16:9 |
| `x-header` | 1500 x 500 | X (Twitter) profile header, 3:1 |
| `youtube-thumbnail` | 1280 x 720 | YouTube thumbnail, 16:9 |
| `pinterest-pin` | 1000 x 1500 | Pinterest pin, 2:3 |
| `og-image` | 1200 x 630 | Open Graph `og:image` link preview |

Add any other exact size with `customSizes` (for example `1000x1000`, each side 16 to 8000 px).

### How to resize an image for Instagram, Facebook and LinkedIn at once

1. Paste the image links in **Image URLs**, one per line.
2. Tick the **Presets** you need, for example `instagram-square`, `facebook-post` and `linkedin-post`.
3. Leave **Fit mode** on `cover` to fill every frame, or choose `blur-pad` to keep the whole image.
4. Run it. Each dataset row has the `url` of one file at the exact preset size.

### How to resize an image without cropping it

Set `fit` to `contain` (pads with `backgroundColor`) or `blur-pad` (pads with a blurred, enlarged copy of the same image, the look used for stories and reels). The whole picture stays visible in the new frame. Example: a 4:3 photo in `instagram-story` with `blur-pad` shows the photo in the middle and a soft blur above and below.

### How to choose what gets cropped

With `fit: "cover"` the image is scaled until it fills the frame and the overflow is cut. `cropFocus` picks which part stays: `center` (default), `top` (keeps heads in portraits), `bottom`, `left` or `right`. It is a fixed position, not subject detection.

### How to make Open Graph (og:image) images in bulk

Use the `og-image` preset (1200 x 630). For a blog or a shop, send the image URLs, keep `outputFormat` on `jpeg`, and use the `url` of each row as the `og:image` value. Files stay available as long as the run's storage is kept; for permanent hosting download them to your own server or CDN.

### Input example

```json
{
  "urls": [
    "https://interactive-examples.mdn.mozilla.net/media/cc0-images/grapefruit-slice-332-332.jpg",
    "https://interactive-examples.mdn.mozilla.net/media/cc0-images/elephant-660-480.jpg"
  ],
  "presets": ["instagram-square", "og-image"]
}
```

More examples:

- `{"presets": ["instagram-story"], "fit": "blur-pad"}` : story size, whole image on a blurred background.
- `{"presets": ["youtube-thumbnail", "x-post"], "cropFocus": "top", "outputFormat": "webp"}` : 16:9 crops keeping the top, as WebP.
- `{"presets": [], "customSizes": ["1000x1000", "600x315"]}` : custom sizes only.

### Input

| Field | Default | What it does |
|---|---|---|
| `urls` (required) | two sample images | Direct image links, one per line |
| `presets` (required) | `instagram-square`, `og-image` | Which sizes to produce (table above) |
| `customSizes` | none | Extra exact sizes as `WIDTHxHEIGHT`, one per line |
| `fit` | `cover` | `cover` (crop), `contain` (pad with a color), `blur-pad` (pad with a blurred copy) |
| `cropFocus` | `center` | `center`, `top`, `bottom`, `left`, `right` |
| `backgroundColor` | `#ffffff` | Padding color for `contain`, and replaces transparency in JPEG |
| `allowUpscale` | on | On: always exact size, small sources are enlarged. Off: small sources are padded instead |
| `outputFormat` | `jpeg` | `jpeg`, `png` (keeps transparency in `cover`) or `webp` |
| `quality` | 90 | 1-100 for JPEG and WebP |
| `stripMetadata` | on | Remove EXIF/GPS and the color profile (orientation is applied first) |
| `maxOutputs` | 100 | Most files delivered and charged in the run (up to 5,000); extra images are skipped, not charged |
| `maxSourceSizeMb` | 25 | Skip larger source files (up to 100) |
| `concurrency` | 4 | Images processed in parallel (1-16) |

### Output

One dataset row per image and preset. This row comes from a real local run of the example above (the link shown is the form it takes on the Apify platform, where it also carries a signature):

```json
{
  "index": 1,
  "sourceUrl": "https://interactive-examples.mdn.mozilla.net/media/cc0-images/grapefruit-slice-332-332.jpg",
  "preset": "og-image",
  "presetLabel": "Open Graph / link preview image (og:image)",
  "fileName": "grapefruit-slice-332-332-og-image.jpg",
  "url": "https://api.apify.com/v2/key-value-stores/<storeId>/records/grapefruit-slice-332-332-1-og-image-faea4d83c3.jpg?signature=...",
  "format": "jpg",
  "width": 1200,
  "height": 630,
  "fit": "cover",
  "originalFormat": "jpg",
  "widthBefore": 332,
  "heightBefore": 332,
  "originalBytes": 18122,
  "outputBytes": 97142,
  "status": "delivered",
  "error": null,
  "note": "source 332x332 is smaller than 1200x630: enlarged, so it may look soft"
}
```

- `status`: `delivered` (file made, charged), `skipped` (duplicate URL, `maxOutputs`, robots.txt, spending limit, SVG, address not allowed; not charged) or `failed` (download error, not an image, too many pixels; not charged). `error` says why.
- An image that cannot be read gives one row with `preset: null`; a preset that fails gives a failed row for that preset only.

### How much does it cost

Pay per event: **$0.004 per preset file delivered** (event `image-preset-output`, $4.00 per 1,000 files), plus the normal Apify platform usage of the run, which is small. Note the unit: one image resized to 4 presets is 4 files. Skipped and failed images are free, and there is no start fee.

- 100 images x 3 presets = 300 files: $1.20
- 1,000 images x 4 presets = 4,000 files: $16.00
- 10,000 images x 1 preset = 10,000 files: $40.00 (run in batches of up to 5,000 files per run)

Set a maximum spending limit on the run: it stops cleanly when reached and the rest are reported as skipped.

### Use cases

- Post one product or event image to Instagram, Facebook, LinkedIn and X without opening an editor.
- Make `og:image` and Twitter-card images for every page of a blog or shop.
- Prepare YouTube thumbnails and channel art at the right size.
- Turn landscape photos into 9:16 story images with a blurred background.
- Add a resize step to a pipeline: another Actor or an AI agent passes image URLs and reads the links from the dataset.

### FAQ

**Does it post to my social accounts?**
No. It only makes the image files. It does not log in to, read or post to any social platform.

**Are the sizes the official ones?**
They are the widely published recommended sizes (for example 1080 x 1080 for an Instagram square post and 1200 x 630 for Open Graph). Platforms change their guidance and crop differently in different views, so check the current rules and use `customSizes` when you need another size.

**Will faces be cropped out?**
Possibly: `cover` cuts the overflow around a fixed focus point and has no face detection. Use `cropFocus: "top"` for portraits, or `contain` / `blur-pad`, which keep the whole image.

**What if my image is smaller than the preset?**
With `allowUpscale` on (default) it is enlarged to the exact size and the `note` says it may look soft. With it off it is never enlarged and is padded with the background color.

**What happens to transparency?**
It is kept for PNG and WebP in `cover`. In `contain` and `blur-pad` the padding is solid or blurred, so the result has no transparency. JPEG cannot store transparency; transparent areas are filled with `backgroundColor`.

**What happens to a URL that robots.txt disallows?**
It is skipped with the reason and not charged. If a host's robots.txt cannot be read because of a server error, its images are skipped too rather than guessed.

### Use with the Apify API, MCP, n8n and Make

Python:

```python
from apify_client import ApifyClient

client = ApifyClient("<APIFY_TOKEN>")
run = client.actor("<username>/social-image-resizer").call(run_input={
    "urls": ["https://example.com/photo.jpg"],
    "presets": ["instagram-square", "linkedin-post"],
    "fit": "blur-pad",
})
for row in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(row["preset"], row["status"], row["url"])
```

JavaScript:

```js
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: '<APIFY_TOKEN>' });
const run = await client.actor('<username>/social-image-resizer').call({
  urls: ['https://example.com/photo.jpg'],
  presets: ['instagram-square', 'linkedin-post'],
  fit: 'blur-pad',
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items.map((r) => [r.preset, r.status, r.url]));
```

The same input works from the Apify MCP server (an AI agent calls the Actor with image URLs and a list of presets), from n8n and from Make through their Apify modules.

### Related tools

- **Batch Image Converter & Resizer: WebP, AVIF, PNG & JPEG** : convert and resize to any format and size, with a file size target.
- **Image Compressor & Resizer: Compress Images in Bulk** : shrink images and keep the original format.
- **Background Remover for Images (rembg, CPU)** : cut out the subject first, then place it in a social size.
- **Download Images from URLs: Bulk Image & File Downloader** : collect the images from pages first, then resize them here.

# Actor input Schema

## `urls` (type: `array`):

Direct links to the image files to resize, one per line. JPEG, PNG, WebP, AVIF, GIF, BMP and TIFF are read. Example: https://example.com/photo.jpg. Web pages, SVG and HEIC are not supported. Use only images you have the right to process.

## `presets` (type: `array`):

Which social-media sizes to produce for every image. One file per image and preset; each file is one charged output. Example: \["instagram-square", "og-image"]. Sizes are the commonly published ones and platforms change them.

## `customSizes` (type: `array`):

Extra exact sizes as WIDTHxHEIGHT in pixels, one per line, each side 16 to 8000. Each size is one more output per image. Example: 1000x1000.

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

How the image is fitted to each size. cover crops, contain pads with Background color, blur-pad pads with a blurred enlarged copy of the same image. Example: cover.

## `cropFocus` (type: `string`):

Which part of the image is kept when cover crops, or where a blur-pad backdrop is centered. It is a fixed position, not face or subject detection. Example: top (keeps heads in portraits).

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

Fills the padding in contain mode and replaces transparency in JPEG output. Hex color. Example: #ffffff.

## `allowUpscale` (type: `boolean`):

On by default, so every file has exactly the preset size even when the source is smaller (it can look soft). Off: a small source is never enlarged and is padded in the background color instead.

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

Format of every output file. Example: jpeg. Instagram, LinkedIn and Facebook uploads accept JPEG and PNG; WebP is not accepted by every upload form.

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

Lossy quality for JPEG and WebP; ignored for PNG. Example: 90.

## `stripMetadata` (type: `boolean`):

Remove EXIF (camera, GPS location) and the color profile. The orientation is always applied to the pixels first, so photos are never rotated wrongly.

## `maxOutputs` (type: `integer`):

Most files delivered (and charged) in this run, counting every image and preset. With 4 presets, 100 means up to 25 images. Images beyond the cap are skipped and not charged. Example: 100.

## `maxSourceSizeMb` (type: `integer`):

Source images larger than this are skipped before they are fully downloaded. Images above 64 megapixels are always refused (memory safety).

## `concurrency` (type: `integer`):

How many images are processed at the same time. Default 4.

## Actor input object example

```json
{
  "urls": [
    "https://interactive-examples.mdn.mozilla.net/media/cc0-images/grapefruit-slice-332-332.jpg",
    "https://interactive-examples.mdn.mozilla.net/media/cc0-images/elephant-660-480.jpg"
  ],
  "presets": [
    "instagram-square",
    "og-image"
  ],
  "fit": "cover",
  "cropFocus": "center",
  "backgroundColor": "#ffffff",
  "allowUpscale": true,
  "outputFormat": "jpeg",
  "quality": 90,
  "stripMetadata": true,
  "maxOutputs": 100,
  "maxSourceSizeMb": 25,
  "concurrency": 4
}
```

# Actor output Schema

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

All result items of this run (the default dataset), as JSON, CSV, Excel and more.

## `records` (type: `string`):

Key-value store records: the run summary, notes on any problems, and any files.

# 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 = {
    "urls": [
        "https://interactive-examples.mdn.mozilla.net/media/cc0-images/grapefruit-slice-332-332.jpg",
        "https://interactive-examples.mdn.mozilla.net/media/cc0-images/elephant-660-480.jpg"
    ],
    "presets": [
        "instagram-square",
        "og-image"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("data-done-right/social-image-resizer").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 = {
    "urls": [
        "https://interactive-examples.mdn.mozilla.net/media/cc0-images/grapefruit-slice-332-332.jpg",
        "https://interactive-examples.mdn.mozilla.net/media/cc0-images/elephant-660-480.jpg",
    ],
    "presets": [
        "instagram-square",
        "og-image",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("data-done-right/social-image-resizer").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 '{
  "urls": [
    "https://interactive-examples.mdn.mozilla.net/media/cc0-images/grapefruit-slice-332-332.jpg",
    "https://interactive-examples.mdn.mozilla.net/media/cc0-images/elephant-660-480.jpg"
  ],
  "presets": [
    "instagram-square",
    "og-image"
  ]
}' |
apify call data-done-right/social-image-resizer --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,data-done-right/social-image-resizer"
        }
    }
}
```

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/AytsPactGKK1li4iH/builds/Vfsey0gU9hTVHWUTB/openapi.json
