Print resolution, bleed and uncompressed bitmap size arithmetic

$0.005 USDC per call · Business, finance and compliance · POST /api/v1/print-estimate · Id print-estimate

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

FieldTypeRequiredDescription
widthPxinteger; 1..1000000yesImage width in pixels.
heightPxinteger; 1..1000000yesImage height in pixels.
unitstring; one of "in", "mm", "cm"noUnit for print size, bleed and margin (default in).
printWidthnumber; 0.001..100000noTrim width in unit.
printHeightnumber; 0.001..100000noTrim height in unit.
bleednumber; 0..10000noBleed added on each side of the trim, in unit (default 0).
marginnumber; 0..10000noSafe margin inside the trim on each side, in unit (default 0).
targetPpinumber; 1..100000noThe resolution you require, in pixels per inch.
channelsinteger; 1..8noChannels per pixel for the raw size (default 3).
bitsPerChannelinteger; one of 1, 8, 16, 32noBits per channel (default 8).
claimedEffectivePpinumber; 0..10000000noAn effective ppi you assert; checked against the computed value.
claimedRawBytesinteger; 0..9000000000000000noAn uncompressed byte count you assert.
ppiTolerancenumber; 0..1000noAccepted 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.

FieldTypeRequiredDescription
statusstring; one of "pass", "fail", "unknown", "unsupported"nopass: 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.
unitstringno
effectivePpiXnumbernoPixels per inch horizontally over trim plus bleed.
effectivePpiYnumbernoPixels per inch vertically.
effectivePpinumbernoThe smaller of the two: the resolution when the image covers the print area.
aspectPixelsnumbernoPixel width / height.
aspectPrintnumbernoTrim width / height.
maxPrintSizeobjectnoLargest width and height in unit at targetPpi.
bleedPixelsRequiredobjectnoPixels needed to cover trim plus bleed at targetPpi (rounded up).
safeAreaobjectnoTrim minus margins, in unit.
rawBitsnumbernoExact width x height x channels x bits.
rawBytesnumbernorawBits / 8 rounded up; uncompressed, unpadded, no header.
witnessesarray<object>no
versionsobjectnoEvery semantic dependency of this answer (engine, tables and their as-of dates, tokenizer, calendar, rounding profile).
limitsarray<string>no
deterministicbooleannoAlways 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