Generate an image

placeholder preview

URL contract

The service is URL-driven. Plain GET requests, validated and deterministic; every response is cacheable (Cache-Control: public, max-age=86400).

Path / queryMeaningExample
/{w}x{h}SVG placeholder (square form: /{size})/600x400
.{svg|png|jpg|jpeg}Output format (default SVG)/600x400.png
/dims/{format}Format as a path segment/600x400/jpg
/dims/{bg}/{fg}[.fmt]Path-supplied colours (fg may carry the format)/600x400/000000/FFFFFF.png
/dims/{bg}/{fg}/{format}Colours + format segments/600x400/000000/FFFFFF/jpeg
@{2x|3x}Retina scale (physical = logical × scale, capped at 4000 px)/600x400@2x.png
?text=…Caption (percent-encoded, max 200 chars; \n or newline = line break)?text=Hello%0AWorld
?bg=… & ?fg=…Colours (hex, named, rgb(), transparent). Query overrides path colours.?bg=0d1117&fg=e6edf3
?font=…Caption font family (bundled set)?font=lato

Limits: dimensions 10–4000 px per side, retina 2×/3×, caption max 200 chars, query max 512 bytes / 16 parameters, colour value max 32 chars. Anything else (unknown parameters, unknown fonts, unknown formats, malformed escapes) returns 400 with a plain-text reason.

Colour precedence: if a colour is given both in the path and in the query, the query wins. A lone path colour (/600x400/000000) is ambiguous and rejected — supply foreground and background together.

Watermark

Every image carries a server-controlled, repeating www.jpgdesign.co.za watermark at low opacity. It is never a request parameter: it cannot be turned off or recoloured by callers, and query strings that try to affect it are rejected. It renders horizontally, spaced about 7 normal spaces apart, in banner font over dark backgrounds and is fully removed for clean output only by explicit operator approval.

JPEG note: JPEG has no alpha channel. Images with a fully transparent background are composited over white before JPEG encoding. Use PNG/SVG when you need transparency.

Examples

Generated live by this server (click to open full size).

Using JPG Placeholder Offline

This service is fully self-contained once the container image is built. All rendering (SVG, PNG, JPEG), watermark compositing, and font rasterization occur locally using bundled OFL-1.1 fonts (PT Sans by default). No external APIs, CDNs, analytics, or network requests are required at runtime.

Access the service from a local network:

All generated URLs are relative to location.origin (the current origin), so they work correctly whether the page is loaded via http://localhost, https://jpgplaceholder.ddns.net, or any other origin. No hard-coded external URLs are embedded in the JavaScript.

To take the service offline entirely (no egress network), start the container on an internal Docker network (e.g. docker network create --internal) — health checks, image generation, and the landing page all function without any outbound network access.