Icon Transforms

Every /icon and /image endpoint (classes, modules, perks, items, monsters, map icons, …) accepts the same set of transform query params. Source bytes are content-addressed and the transform is deterministic, so variant URLs inherit the source's immutable cache headers — browsers and CDNs hold a variant forever per patch.

No params → original bytes are streamed unchanged (BinaryFileResponse fast path). Any one param flips the request into the Imagick pipeline.

ParamValuesNotes
sizeN or WxH1–512 per axis. Plain 64 means 64×64.
dpr1 · 2 · 3Multiplies size for retina renders. size=64&dpr=2 → 128×128.
formatpng · webpWebP is ~30% smaller than PNG for the same image. Other formats register only when the API container ships their delegate.
trimbare flag · true · falseAuto-strips transparent margin with a 1% fuzz. Useful when the source PNG has heavy padding (most perk + class icons).
bg#RRGGBB · #RRGGBBAA · transparentBackground fill. Required if you flatten to an opaque format and want anything other than black behind transparent pixels.

Invalid input returns 400 with the rule that failed. The original source is always reachable by omitting every transform param.

Examples

The same source icon, resized and re-encoded to WebP:

GET/v2/classes/id.class.fighter/icon?size=128&format=webp

The same icon trimmed of its transparent margin and flattened onto a solid background:

GET/v2/classes/id.class.fighter/icon?size=128&trim=true&bg=%23ffce79