Print resolution, bleed and uncompressed bitmap size arithmetic
Given an image's pixel size and a print size (inches, millimetres or centimetres) plus optional bleed, margin and target ppi, returns the effective ppi over trim plus bleed, whether it meets the target, the pixel count a target ppi needs, the largest print size a target ppi allows, the safe area, and the exact uncompressed bitmap size. Built for print-on-demand, layout and image-prep agents; the target ppi is yours to choose, there is no built-in quality rule. Unit maths is exact (1 in = 25.4 mm). It does not estimate compressed file sizes (JPEG, PNG, TIFF/LZW), colour management or printer-specific limits, and the raw size counts pixels only (no headers, row padding or alpha unless in channels).
What you get
Exact ppi, bleed and byte counts for print jobs without unit-conversion slips.
Call it
Send the JSON body below to https://agents.writerslogic.com/api/v1/print-estimate. An unpaid request answers 402 with the price and how to pay; a request that fails with a 5xx status is not charged.
curl -i -X POST https://agents.writerslogic.com/api/v1/print-estimate \
-H 'content-type: application/json' \
-d '{"widthPx":3000,"heightPx":2000,"printWidth":10,"printHeight":6.667,"bleed":0.125,"targetPpi":300,"unit":"in"}'
Input
| Field | Type | Required | Description |
|---|---|---|---|
widthPx | integer; 1..1000000 | yes | Image width in pixels. |
heightPx | integer; 1..1000000 | yes | Image height in pixels. |
unit | string; one of "in", "mm", "cm" | no | Unit for print size, bleed and margin (default in). |
printWidth | number; 0.001..100000 | no | Trim width in unit. |
printHeight | number; 0.001..100000 | no | Trim height in unit. |
bleed | number; 0..10000 | no | Bleed added on each side of the trim, in unit (default 0). |
margin | number; 0..10000 | no | Safe margin inside the trim on each side, in unit (default 0). |
targetPpi | number; 1..100000 | no | The resolution you require, in pixels per inch. |
channels | integer; 1..8 | no | Channels per pixel for the raw size (default 3). |
bitsPerChannel | integer; one of 1, 8, 16, 32 | no | Bits per channel (default 8). |
claimedEffectivePpi | number; 0..10000000 | no | An effective ppi you assert; checked against the computed value. |
claimedRawBytes | integer; 0..9000000000000000 | no | An uncompressed byte count you assert. |
ppiTolerance | number; 0..1000 | no | Accepted ppi difference for claimedEffectivePpi (default 0.5). |
Example request body
{
"widthPx": 3000,
"heightPx": 2000,
"printWidth": 10,
"printHeight": 6.667,
"bleed": 0.125,
"targetPpi": 300,
"unit": "in"
}
Result
The response is { "data": ..., "_provenance": ... }. data carries these fields; _provenance is a signed W3C Verifiable Credential with a C2PA-style manifest, checked free at POST /api/v1/verify-provenance.
| Field | Type | Required | Description |
|---|---|---|---|
status | string; one of "pass", "fail", "unknown", "unsupported" | no | pass: every rule held. fail: a rule was violated (see witnesses). unknown: the input lacks the evidence to decide. unsupported: outside what this engine covers. Missing evidence is never a pass. |
unit | string | no | |
effectivePpiX | number | no | Pixels per inch horizontally over trim plus bleed. |
effectivePpiY | number | no | Pixels per inch vertically. |
effectivePpi | number | no | The smaller of the two: the resolution when the image covers the print area. |
aspectPixels | number | no | Pixel width / height. |
aspectPrint | number | no | Trim width / height. |
maxPrintSize | object | no | Largest width and height in unit at targetPpi. |
bleedPixelsRequired | object | no | Pixels needed to cover trim plus bleed at targetPpi (rounded up). |
safeArea | object | no | Trim minus margins, in unit. |
rawBits | number | no | Exact width x height x channels x bits. |
rawBytes | number | no | rawBits / 8 rounded up; uncompressed, unpadded, no header. |
witnesses | array<object> | no | |
versions | object | no | Every semantic dependency of this answer (engine, tables and their as-of dates, tokenizer, calendar, rounding profile). |
limits | array<string> | no | |
deterministic | boolean | no | Always true: pure code, no model. |
Pay and connect
Available through: x402 (USDC on Base), MCP. MCP clients reach it through the creative-games-kit package.
Machine-readable
- This agent as JSON (schemas, example, OpenAPI operation)
- Free signed sample response
- OpenAPI 3.1 · Catalog · Index of every agent