# Batch Image Processor: Resize, Convert, Watermark (`bardach_technologies/batch-image-processing-toolkit`) Actor

Batch image processor: resize, crop, convert (JPG, PNG, WebP), watermark, remove all metadata except the ICC colour profile, including EXIF location, with contact sheet, from links or stored files. One status row per image, failures free. From USD 0.0015 per image. Platform run 28.11: 1 item, 3.3 s.

- **URL**: https://apify.com/bardach_technologies/batch-image-processing-toolkit.md
- **Developed by:** [Bardach Technologies](https://apify.com/bardach_technologies) (community)
- **Categories:** Automation, Developer tools
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.50 / 1,000 images processed, small

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/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

**Batch image processor** for up to 500 images per run, from public links or files in a key-value store: it resizes, crops, converts (JPG, PNG, WebP), watermarks, removes all metadata except the ICC colour profile (kept so colours stay correct) and can build a contact sheet, with one status row per image. It runs open-source libraries inside the Actor, with no paid AI service. **All metadata, including EXIF location, is always removed except the ICC colour profile (kept so colours stay correct)** (there is no option to keep any other) and every result file is read back to prove it. One run on the Apify platform, 28.11.2026, succeeded with 1 item in 3.3 s. See "Measured and not measured".

Try it: click **Start** with the prefilled input. It holds the built-in sample picture (drawn by the Actor, 1600 x 1200, with a made-up GPS position in its EXIF block) and two test pictures from Lorem Picsum. All 3 are shrunk to fit 800 x 800 and saved as WebP, and the rows show which metadata went in and that none came out. Replace the links with your own images.

### Sample output table

The one-click default run (the prefilled input, run locally on 29.11.2026) produced 3 rows in 3 seconds, all with status ok, and cost 3 x USD 0.0015 = USD 0.0045 plus Apify's start event (USD 0.00005), USD 0.00455 in all. All 3 rows:

| position | source | source size | output | output size | metadataRemoved | outputHasGpsLocation | status |
|---|---|---|---|---|---|---|---|
| 1 | jpg | 1600 x 1200 | webp 800 x 600 | 10640 bytes | exif, gpsLocation | false | ok |
| 2 | jpg | 800 x 600 | webp 800 x 600 | 80028 bytes | exif | false | ok |
| 3 | jpg | 800 x 600 | webp 800 x 600 | 52762 bytes | exif | false | ok |

Row 1 is the built-in picture with its made-up GPS position; rows 2 and 3 are the two Lorem Picsum test pictures, saved as WebP.

### Input

| Field | What you set |
|---|---|
| `imageUrls` | Links to the images the batch image processor should handle, one per line, up to 500 together with uploaded files. Prefilled with two public test pictures from Lorem Picsum. |
| `sampleImage` | Adds the built-in sample picture (drawn by the Actor, with a made-up GPS position). Prefilled on. |
| `resizeMode`, `width`, `height` | `none`, `fit`, `fill` or `exact` and the box in pixels. Prefilled: `fit` into 800 x 800. |
| `outputFormat` | `keep`, `jpg`, `png` or `webp`. Prefilled: `webp`. |
| `contactSheet` | One JPG with up to 100 thumbnails of the results. Off by default. |

Metadata needs no setting: all of it is always removed except the ICC colour profile. The other fields (crop, trim, watermark, quality, limits) are listed under "All input fields".

### Use cases

- Shop and catalogue teams: every product photo to WebP at 1600 px wide with a watermark.
- Journalists and community managers: strip location before publishing photos, with proof per file (`sourceHadGpsLocation` and `outputHasGpsLocation`).
- Marketplace sellers: crop to 1:1 or 4:5, pad to an exact box on a white canvas, and get a contact sheet of the batch for a quick review.

### Use it from n8n, Make, the API or an AI agent

1. Build the list of image links (a column in your sheet, a database query, or the output of an earlier step).
2. Call this Actor with a JSON input such as the minimal input below, with your links in `imageUrls`. In n8n or Make use the Apify module (run Actor, then get dataset items); with the API start a run and read the default dataset; an AI agent can call the Actor as a tool with the same JSON.
3. Read one row per image. Match rows to your list by `position` (a row never shows the link). Keep rows with `status` ok, and fetch each result file from the run's key-value store by `outputKey`.
4. Rows with another status are not charged by this Actor; retry them later or fix the link.

### Related Actors

- **Our dataset merge Actor** (Apify Store; search for "Merge Datasets & Remove Duplicates by Field"): joins the rows of several runs into one dataset without duplicates.
- **Our bulk HTTP requests Actor** (Apify Store; search for "Bulk HTTP Requests: Batch API Calls, GET & POST"): checks that a list of image links answers before you process them.

### Use it when

- You have a list of image links or files in a key-value store and want them resized, cropped to a ratio, converted to WebP, JPG or PNG, or watermarked in one run, with one row per image saying what happened.
- You publish photos and want the **location and all other metadata removed** before they go online, with proof per file (`sourceHadGpsLocation` and `outputHasGpsLocation`).
- You want to know which images failed and why (not found, not an image, too many pixels, animated, cut off) without paying for them.
- You want one **contact sheet** (up to 100 thumbnails) of a batch to check it at a glance.

### Do not use it when

- You need image generation, AI upscaling, face or object detection, or AI background removal. None of that is here; the background options are only: trim a uniform border, pad to a canvas colour, flatten transparency onto a colour.
- You need to choose the smallest file that still looks the same as the original (a similarity target); that is a different Actor, the image compressor with an SSIM target. Here quality is a number you set.
- You need HEIC, RAW, SVG or PDF, or a GIF or TIFF with more than one frame. They get a free status row. Animation is judged by the frames in the file: a GIF saved with two identical frames holds one frame and is processed.
- You do not hold the rights to the images. You must hold the rights to every image you give this Actor and to the results.

### Why choose it

Every image gets its own row with a status and a plain reason, and only `ok` rows are charged. Before any pixel is decoded the Actor checks the bytes (size, the format named by the first bytes), then the header (pixel count, side length, frames); links are refused when they point at private, local or cloud-metadata addresses, also after redirects. A link may be delivered from another host after a redirect (at most 5, never from https to http); the target address is not shown in any row, log or status. A killed run resumes from its own output without duplicate rows or double charges, and the spending limit stops it cleanly. Public Store figures read on 18.11.2026 for other image tools, not for this Actor: a batch converter with 90 users in 30 days showed 84.7 % successful runs, an image metadata tool 79.3 %, and the busiest image upscaler (280 users, about 9 % of the image-processing demand) 41.5 %. The one platform run above is the only platform figure so far.

### Minimal input and one output row

```json
{ "sampleImage": true, "resizeMode": "fit", "width": 800, "height": 800, "outputFormat": "webp" }
```

One row from that input, run locally on 19.11.2026 (the link is shortened):

```json
{
  "position": 1,
  "key": "sample:built-in",
  "kind": "image",
  "source": "sample",
  "input": "built-in sample picture (drawn, with fictional EXIF location)",
  "inputMasked": false,
  "status": "ok",
  "statusDetail": null,
  "attempts": 0,
  "sourceBytes": 89520,
  "sourceFormat": "jpg",
  "sourceWidth": 1600,
  "sourceHeight": 1200,
  "sourceMegapixels": 1.92,
  "outputWidth": 800,
  "outputHeight": 600,
  "outputBytes": 10640,
  "outputFormat": "webp",
  "outputKey": "out-00001-4bb12761.webp",
  "outputUrl": "<public link of the stored file>",
  "operations": ["resize fit", "convert jpg->webp"],
  "notes": [],
  "sourceHadGpsLocation": true,
  "sourceHadExif": true,
  "metadataRemoved": ["exif", "gpsLocation"],
  "outputHasGpsLocation": false,
  "outputHasExif": false,
  "outputKeepsColorProfile": false,
  "processingMs": 90,
  "sheet": null,
  "chargeDue": true,
  "chargeEvents": ["image-processed"],
  "priceDueUsd": 0.0015,
  "rightsNotice": "You must hold the rights to every image you give this Actor and to the results.",
  "costNote": null
}
```

### How to use it

1. Put image links in **Batch image processor: image links**, or upload files to a key-value store and list their keys in **Batch image processor: uploaded images** (pick the store in the field).
2. Choose the operations. They always run in this order: turn upright, trim borders, crop to ratio, resize, pad to box, watermark, flatten transparency, convert and encode.
3. Nothing to set for metadata: every result has EXIF (including GPS), XMP, IPTC and text comments (JPEG comment segments, PNG text chunks, GIF comments) removed, and the Actor writes no EXIF of its own. The ICC colour profile is kept because it carries colour, not location. Every result is opened again and checked; a file that still carries metadata is not stored and gets a free `processingError` row.
4. Start the run, then read the rows in the Output tab and download the results from the key-value store (`out-00001-...`). With **Batch image processor: make a contact sheet** the last row points to `contact-sheet.jpg`.

### All input fields

| Field | What it does | Default |
|---|---|---|
| `imageUrls`, `fileKeys`, `keyValueStoreId`, `sampleImage` | Where the images come from: up to 500 together, 30 MB each. | empty |
| `autoOrient`, `trimBorders`, `trimTolerance`, `cropAspectRatio`, `cropGravity` | Turn upright from the EXIF tag, trim a uniform border, crop to a ratio such as 4:5. | on, off, 10, none, center |
| `resizeMode`, `width`, `height`, `allowUpscale`, `padToBox`, `backgroundColor` | none, fit, fill or exact; pictures are not enlarged unless allowed. | none, off, off, #ffffff |
| `watermarkText`, `watermarkLogoKey`, `watermarkPosition`, `watermarkOpacity`, `watermarkSizePercent` | Text (Latin font) or a logo from your store. | none, bottom-right, 40, 20 |
| `outputFormat`, `quality` | keep, jpg, png or webp; quality 1 to 100 for JPG and WebP. | keep, 85 |
| `contactSheet`, `contactSheetColumns`, `contactSheetThumbnailPx`, `contactSheetLabels` | One JPG of up to 100 thumbnails. | off, 5, 160, on |
| `maxOutputMegapixels`, `maxAttempts` | Refuse results above this size (free row); download tries. | 25, 3 |

### Output

One dataset row per image in input order (and one last row for the sheet), and a `OUTPUT` record with how the run ended (`complete`, `hostsRefused` when a host refused a link, `stoppedEarly`, `incomplete`), the events charged (`chargedEvents`, `itemsCharged`, read from the platform), the number of refused hosts (`hostsRefused`) and of links not requested from them (`linksNotRequested`). Status values: `ok`, `blocked`, `refused`, `hostStopped`, `notFound`, `downloadFailed`, `tooLarge`, `notAnImage`, `tooManyPixels`, `animated`, `corrupt`, `outputTooLarge`, `processingError`, `noImages`. Results are files in the run's key-value store, named `out-<position>-<hash>.<ext>`.

`input` is the fixed text `(link not shown; match by position)` for every link, whatever it holds: nothing of a link is shown, so match rows to your list by `position`; `inputMasked` is then true. For an uploaded file `input` is its key (letters, digits and `!-_.'()` only) with phone-number-like tokens (a number next to a phone word such as `tel`, `phone` or `mobile`) replaced by `[removed]`, for example `tel-4915112345678-photo.jpg` shows as `[removed]` and `mobile(436641234567).jpg` as `mobile[removed]).jpg`. `key` (`url-<position>-<digest>`, `kv-<position>-<digest>`) and the result file name are built from the position and a digest, never from the link text.

`metadataRemoved` lists only the kinds (`exif`, `gpsLocation`, `makerNote`, `xmp`, `iptc`, `textComments`) the original carried and the written result no longer carries, both read from the bytes. A row shows the price due (`chargeDue`, `chargeEvents`, `priceDueUsd`); the run's charge log and the `OUTPUT` record are the record of what was charged.

### Measured and not measured

One process per image, local Mac (macOS 15, Python 3.12, Pillow 13), while the machine was busy (load average above 20), so times are worse than a quiet machine. Task: fit 1600 x 1600, watermark, WebP quality 82, strip all. Median of 3 runs for time, highest of 3 for memory. Pictures are generated (gradient plus noise).

| Original | Size | CPU s | Wall s | Peak memory MB |
|---|---|---|---|---|
| JPG 1 MP | 0.2 MB | 0.116 | 0.123 | 55 |
| JPG 4 MP | 0.8 MB | 0.204 | 0.205 | 105 |
| JPG 12 MP | 2.3 MB | 0.273 | 0.324 | 144 |
| JPG 24 MP | 4.7 MB | 0.402 | 0.425 | 200 |
| JPG 40 MP | 7.8 MB | 0.428 | 0.537 | 293 |
| PNG 4 MP | 7.8 MB | 0.249 | 0.259 | 112 |
| PNG 12 MP | 23.4 MB | 0.383 | 0.394 | 165 |

A contact sheet of 100 tiles took 5.5 s CPU and 393 MB at peak. The default run memory is 1,024 MB. Platform: One run on the Apify platform, 28.11.2026, succeeded with 1 item in 3.3 s (publish log); not measured: the default prefilled run on Apify, memory limits, real photographs, the busiest case of 500 large images in one run, and the sheet with outputs larger than the generated ones.

### FAQ

**Is the location really removed?** Yes, always: all EXIF (GPS included), XMP, IPTC and text comments are removed from every result, the written file is opened again and checked, and a file that still carries any of it is not stored and gets a free `processingError` row. A picture can still show a place in its pixels (a street sign). There is no setting to keep EXIF.

**Why was my image refused?** `statusDetail` says why in plain words.

**What happens when the run is stopped or crashes?** Resurrect it: finished rows stay, nothing is processed or charged twice, and refused hosts stay stopped (a host whose stop was being saved in the very moment of the kill gets one more request after the restart). A row written just before a crash can stay unpaid; none is charged twice. Rows show the price due; the charge log is the record of what was charged.

### Limits

- Libraries: Pillow (MIT-CMU licence) and the Python standard library; no paid AI service.
- Output format: `outputFormat: keep` keeps JPG, PNG and WebP as they are; GIF, BMP and TIFF become PNG.
- Formats in: JPEG, PNG, WebP, GIF (first and only frame), BMP, TIFF; out: JPG, PNG, WebP. 40 megapixels, 16,000 px on a side and 30 MB per original; 500 images per run.
- Links are read one at a time, with a short pause per host, and only public http and https addresses. The links are fetched as given: the Actor does not read robots.txt for direct file links you supply, and follows no link found inside a file. A link may be delivered from another host after a redirect; the target address is not shown. Characters outside ASCII in a link or a redirect target are sent percent-encoded as UTF-8 (`größe.jpg` as `gr%C3%B6%C3%9Fe.jpg`); a host name outside ASCII is converted with the IDNA 2003 rules of Python (`xn--...`), which map some characters differently from a browser: `straße.example` is requested as `strasse.example` (a browser would ask for `xn--strae-oqa.example`), and a zero-width joiner is dropped, so give such a host in its `xn--` form. A host name with no IDNA form, a link holding a lone surrogate half or characters that cannot be sent in a web request gets a free `blocked` row. A redirect target sent as raw UTF-8 bytes is read as UTF-8 and followed the same way (host in IDNA form, path percent-encoded); bytes that are not UTF-8 are percent-encoded as received; a redirect that is not a valid web address gets a free `blocked` row ("not a valid web address").
- A host that answers 401, 403, 407, 429 or 451, or with a challenge page, is not asked again in this run: that link gets a free `refused` row and every later link on that host a free `hostStopped` row without a request, also after a restart; only when the run is killed in the very moment the host's stop is being saved does that host get one more request after the restart. The Actor cannot tell a rate limit from a refusal, so a 429 stops the host too; run those links again later. 404 and 410 give `notFound`; 408, 425 and 5xx answers and broken transfers are tried again up to `maxAttempts`, all tries of one link within one time limit of 300 s.
- Watermark text uses the bundled Latin font; letters it lacks show as boxes. A watermark is drawn into the pixels and can be cropped out by someone else, so it is not a security measure.
- Contact sheets hold at most 100 tiles; a note on the row says how many were left out.
- The two test links in the prefilled input belong to a third-party host (Lorem Picsum). If it answers 429 or is down, that link gets a free `refused` row and the other a free `hostStopped` row; the run still finishes, and the built-in sample picture is row 1 either way. Your own links are the normal use.

### Pricing

Pay per event, one event per `ok` image, by the size of the original as measured on the downloaded bytes:

| Event | Original up to | USD |
|---|---|---|
| `image-processed` | 12 megapixels and 2 MB | 0.0015 |
| `image-processed-medium` | 24 megapixels and 8 MB | 0.0045 |
| `image-processed-large` | 40 megapixels and 30 MB (the limits) | 0.016 |
| `contact-sheet` | one sheet, up to 100 tiles | 0.01 |

Apify charges its own start event (USD 0.00005) at the start of every run, including a run that ends at once or fails on bad input; this Actor's code does not charge it. Worked example: 100 phone-size photos under 2 MB cost 100 x 0.0015 = USD 0.15, and USD 0.16 with a sheet. Failed, refused and skipped images are not charged by this Actor (the start event still applies), and the Actor never charges more than the maximum you set: before each image it checks that the limit can pay for that image (and for the sheet, when one is due) and stops cleanly if not. The prices follow the cost per image measured below, with a margin of at least 5 % at the largest image of each tier.

# Actor input Schema

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

Links to the images the batch image processor should handle: direct links to JPG, PNG, WebP, GIF, BMP or TIFF images, one per line, up to 500 together with the uploaded files, each at most 2,000 characters and 30 MB. Only http and https; private, local and cloud-metadata addresses are refused, also after redirects. A link may be delivered from another host after a redirect; the target address is not shown. A host that answers 401, 403, 407, 429 or 451, or with a challenge page, is not asked again in this run (free rows). A row never shows the link: its input field holds the fixed text (link not shown; match by position), so match rows to your list by position. You must hold the rights to every image you give and to the results. Default: empty.

## `fileKeys` (type: `array`):

Images for the batch image processor that you uploaded yourself: keys of image files in a key-value store you own, one per line, up to 200, at most 30 MB each. Pick the store below; empty means this run's own store. Keys starting with out- or contact-sheet and the Actor's own records are refused. Default: empty.

## `keyValueStoreId` (type: `string`):

The key-value store that holds the files named in Batch image processor: uploaded images and the watermark logo. Leave empty to read from this run's own default store. Results are always written to this run's own store, not to this one.

## `sampleImage` (type: `boolean`):

Adds one picture drawn by the Actor (1600 x 1200, no photograph) whose EXIF block holds a made-up GPS position, so a first run shows the location being removed. It needs no website and no file. Default: off.

## `autoOrient` (type: `boolean`):

Rotates or mirrors the pixels as the camera's orientation tag says, before any other step, so the result looks right without the tag. Default: on.

## `trimBorders` (type: `boolean`):

Cuts away a border of one colour (the colour of the top-left pixel, or a fully transparent border) before cropping and resizing. Nothing is cut when the whole picture is one colour. Default: off.

## `trimTolerance` (type: `integer`):

How far a pixel may differ from the border colour and still count as border, from 0 (exact) to 64, on a 0 to 255 scale. Only used with Trim uniform borders. Default: 10.

## `cropAspectRatio` (type: `string`):

Cuts the picture to this ratio, written width:height such as 1:1, 4:5 or 16:9, without scaling it. The cut is placed by Crop position. Empty means no ratio crop. Default: empty.

## `cropGravity` (type: `string`):

Where the kept part sits when the ratio crop or the Fill resize mode has to cut something away: center, top, bottom, left or right. Default: center.

## `resizeMode` (type: `string`):

none keeps the size; fit makes the picture fit inside the width and height (either may be left empty) keeping its ratio; fill covers the box exactly and cuts the overflow; exact stretches to the box. Default: none.

## `width` (type: `integer`):

Target width in pixels, from 16 to 8000. Needed for fill and exact; fit needs a width, a height or both. Pictures are not enlarged unless Allow enlarging is on. Default: not set.

## `height` (type: `integer`):

Target height in pixels, from 16 to 8000. Needed for fill and exact; fit needs a width, a height or both. Pictures are not enlarged unless Allow enlarging is on. Default: not set.

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

When off, a picture smaller than the box is kept at its own size (fill and exact shrink the box to the same ratio instead). When on, pictures are scaled up with the same filter. Default: off.

## `padToBox` (type: `boolean`):

With Fit and both width and height set, puts the resized picture in the middle of a canvas of exactly width x height in the background colour. Transparent formats keep an opaque canvas. Default: off.

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

Colour like #ffffff used behind transparency when the result is a JPG, for padding and for the contact sheet. Three or six hex digits. Default: #ffffff.

## `watermarkText` (type: `string`):

One line of text, at most 120 characters, drawn in white with a dark outline on every picture, in the bundled Latin font. Letters missing from that font show as boxes. Empty means no text. Ignored when a logo key is set. Default: empty.

## `watermarkLogoKey` (type: `string`):

Key of a logo image (JPG, PNG or WebP, at most 5 MB and 4 megapixels) in the key-value store above; a PNG with transparency works best. It replaces the text. If it cannot be read the run stops before anything is processed or charged. Default: empty.

## `watermarkPosition` (type: `string`):

Corner or centre where the text or logo is placed, with a small margin. Default: bottom-right.

## `watermarkOpacity` (type: `integer`):

How opaque the watermark is, from 5 to 100 percent. Default: 40.

## `watermarkSizePercent` (type: `integer`):

Width of the watermark as a percentage of the picture's width, from 5 to 60. Default: 20.

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

keep writes JPG as JPG, PNG as PNG and WebP as WebP (GIF, BMP and TIFF become PNG); or choose jpg, png or webp for every picture. Default: keep.

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

Encoder quality from 1 to 100 for JPG and WebP results; PNG is always lossless. Default: 85.

## `contactSheet` (type: `boolean`):

Adds one last row and one JPG sheet (contact-sheet.jpg) with thumbnails of the delivered results, up to 100 tiles. It is charged only when it is made. Default: off.

## `contactSheetColumns` (type: `integer`):

Tiles per row on the contact sheet, from 1 to 12. Default: 5.

## `contactSheetThumbnailPx` (type: `integer`):

Longest side of each tile in pixels, from 64 to 400. Default: 160.

## `contactSheetLabels` (type: `boolean`):

Writes a short name (the file name of an uploaded file, or link <position> for a link) under each tile of the contact sheet. Default: on.

## `maxOutputMegapixels` (type: `number`):

Pictures whose planned result is larger than this get a free outputTooLarge row and are not processed, so a wrong size cannot create a huge file. From 0.1 to 100. Default: 25.

## `maxAttempts` (type: `integer`):

How often a link is tried when the host answers with a temporary error (408, 425 or 5xx) or the transfer breaks, from 1 to 5, with growing pauses, all within one time limit of 300 s per link. 401, 403, 407, 429 and 451 are never retried: they stop that host for the run. Default: 3.

## Actor input object example

```json
{
  "imageUrls": [
    "https://picsum.photos/id/10/800/600.jpg",
    "https://picsum.photos/id/20/800/600.jpg"
  ],
  "fileKeys": [
    "shop-photo-001.jpg"
  ],
  "sampleImage": true,
  "autoOrient": true,
  "trimBorders": false,
  "trimTolerance": 10,
  "cropAspectRatio": "4:5",
  "cropGravity": "center",
  "resizeMode": "fit",
  "width": 800,
  "height": 800,
  "allowUpscale": false,
  "padToBox": false,
  "backgroundColor": "#ffffff",
  "watermarkText": "Sample",
  "watermarkPosition": "bottom-right",
  "watermarkOpacity": 40,
  "watermarkSizePercent": 20,
  "outputFormat": "webp",
  "quality": 85,
  "contactSheet": false,
  "contactSheetColumns": 5,
  "contactSheetThumbnailPx": 160,
  "contactSheetLabels": true,
  "maxOutputMegapixels": 25,
  "maxAttempts": 3
}
```

# Actor output Schema

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

One row per image, in input order, with a status, sizes, metadata proof and the link to the result.

## `summary` (type: `string`):

How the run ended (complete, hostsRefused, stoppedEarly or incomplete), counts per status, refused hosts, links not requested and the events charged.

# 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://picsum.photos/id/10/800/600.jpg",
        "https://picsum.photos/id/20/800/600.jpg"
    ],
    "sampleImage": true,
    "resizeMode": "fit",
    "width": 800,
    "height": 800,
    "outputFormat": "webp"
};

// Run the Actor and wait for it to finish
const run = await client.actor("bardach_technologies/batch-image-processing-toolkit").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://picsum.photos/id/10/800/600.jpg",
        "https://picsum.photos/id/20/800/600.jpg",
    ],
    "sampleImage": True,
    "resizeMode": "fit",
    "width": 800,
    "height": 800,
    "outputFormat": "webp",
}

# Run the Actor and wait for it to finish
run = client.actor("bardach_technologies/batch-image-processing-toolkit").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://picsum.photos/id/10/800/600.jpg",
    "https://picsum.photos/id/20/800/600.jpg"
  ],
  "sampleImage": true,
  "resizeMode": "fit",
  "width": 800,
  "height": 800,
  "outputFormat": "webp"
}' |
apify call bardach_technologies/batch-image-processing-toolkit --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,bardach_technologies/batch-image-processing-toolkit"
        }
    }
}
```

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/tVLe3naffsWYvf57f/builds/E8ERdwrSKWL6U4NfK/openapi.json
