Generate an image
URL contract
The service is URL-driven. Plain GET requests, validated and
deterministic; every response is cacheable (Cache-Control: public, max-age=86400).
| Path / query | Meaning | Example |
|---|---|---|
| /{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).