# Print-Ready Image Upscaler (300 DPI for KDP, Etsy, POD) (`efraingaray/print-ready-image-upscaler`) Actor

Upscale images to an exact print size at 300 DPI with Real-ESRGAN: KDP trim sizes with bleed, Etsy and poster print sizes, A-series. Outputs PNG, JPEG, TIFF or a print-ready PDF page with the DPI written in the file.

- **URL**: https://apify.com/efraingaray/print-ready-image-upscaler.md
- **Developed by:** [Efrain Garay](https://apify.com/efraingaray) (community)
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 1,000 image processeds

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## Print-Ready Image Upscaler (300 DPI for KDP, Etsy, POD)

Turn a small image into a file a print shop accepts. You pick the print size, and you get that exact size at 300 DPI with the DPI written into the file. Real-ESRGAN AI upscaling keeps the edges sharp, where a plain resize turns them blurry.

### Who it is for

- **Amazon KDP:** coloring books, low-content books, picture books, covers. All trim sizes, with optional 0.125" bleed.
- **Etsy printable wall art:** 4x6 up to 24x36 posters, from one image.
- **Print-on-demand:** Printful, Redbubble, Society6 and local print shops.
- **Anyone** whose printer says "image resolution too low".

### What you get

- **Exact pixel size** for the trim. KDP 8.5x11 at 300 DPI is 2550x3300; with bleed it is 2625x3375.
- **DPI metadata** in PNG, JPEG and TIFF.
- **PDF:** a page at the real trim size, ready for KDP.
- **Landscape images** rotate the preset automatically.
- **Fit modes:**
  - `cover` fills the page and crops the excess;
  - `contain` keeps the whole image with margins;
  - `stretch` distorts it to fill.
- **Transparency** kept in PNG and TIFF.
- **One result per image** in the dataset, with the output URL and its size. A failed image is reported and **not charged**.

### Input

| Field | Example |
|---|---|
| `images` | list of image URLs |
| `preset` | `kdp-8.5x11`, `kdp-6x9`, `print-8x10`, `print-24x36`, `a4`, `custom` |
| `customWidthInches` / `customHeightInches` | for `custom` |
| `dpi` | `300` |
| `bleedInches` | `0.125` for KDP full bleed |
| `fit` | `cover`, `contain`, `stretch` |
| `format` | `png`, `jpeg`, `tiff`, `pdf` |

### Output (dataset item)

```json
{
  "sourceUrl": "https://example.com/page.png",
  "outputUrl": "https://api.apify.com/v2/key-value-stores/.../records/000-page.png",
  "widthPx": 2550, "heightPx": 3300, "widthInches": 8.5, "heightInches": 11, "dpi": 300,
  "format": "png", "sourceWidthPx": 850, "sourceHeightPx": 1108, "upscaleFactor": 3.0, "error": null
}
```

### Speed

A letter page at 300 DPI takes a few seconds on CPU. Very large posters (24x36) take longer.

### Credits

Upscaling model: [Real-ESRGAN](https://github.com/xinntao/Real-ESRGAN) `realesr-general-x4v3` by Xintao Wang et al., BSD 3-Clause license.

# Actor input Schema

## `images` (type: `array`):

Public URLs of the images (PNG, JPEG, WebP, TIFF). Up to 40 MB each.

## `preset` (type: `string`):

Trim size in inches. Rotated automatically for landscape images. Use 'custom' for any size.

## `customWidthInches` (type: `number`):

Only for the 'custom' preset.

## `customHeightInches` (type: `number`):

Only for the 'custom' preset.

## `dpi` (type: `integer`):

300 is the standard for KDP and most print shops.

## `bleedInches` (type: `number`):

KDP full-bleed pages use 0.125.

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

cover: fill the page and crop the excess. contain: whole image with margins. stretch: distort to fill.

## `background` (type: `string`):

Hex color of the margins when fit is contain.

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

Output format

## Actor input object example

```json
{
  "images": [
    {
      "url": "https://upload.wikimedia.org/wikipedia/commons/thumb/a/a7/Camponotus_flavomarginatus_ant.jpg/330px-Camponotus_flavomarginatus_ant.jpg"
    }
  ],
  "preset": "kdp-8.5x11",
  "dpi": 300,
  "bleedInches": 0,
  "fit": "cover",
  "background": "#ffffff",
  "format": "png"
}
```

# Actor output Schema

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

No description

## `files` (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 = {
    "images": [
        {
            "url": "https://upload.wikimedia.org/wikipedia/commons/thumb/a/a7/Camponotus_flavomarginatus_ant.jpg/330px-Camponotus_flavomarginatus_ant.jpg"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("efraingaray/print-ready-image-upscaler").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 = { "images": [{ "url": "https://upload.wikimedia.org/wikipedia/commons/thumb/a/a7/Camponotus_flavomarginatus_ant.jpg/330px-Camponotus_flavomarginatus_ant.jpg" }] }

# Run the Actor and wait for it to finish
run = client.actor("efraingaray/print-ready-image-upscaler").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 '{
  "images": [
    {
      "url": "https://upload.wikimedia.org/wikipedia/commons/thumb/a/a7/Camponotus_flavomarginatus_ant.jpg/330px-Camponotus_flavomarginatus_ant.jpg"
    }
  ]
}' |
apify call efraingaray/print-ready-image-upscaler --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,efraingaray/print-ready-image-upscaler"
        }
    }
}
```

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/SP16fR57NITx4Hkkm/builds/poMJuPCdc8GMbDKlY/openapi.json
