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.
| Param | Values | Notes |
|---|---|---|
| size | N or WxH | 1–512 per axis. Plain 64 means 64×64. |
| dpr | 1 · 2 · 3 | Multiplies size for retina renders. size=64&dpr=2 → 128×128. |
| format | png · webp | WebP is ~30% smaller than PNG for the same image. Other formats register only when the API container ships their delegate. |
| trim | bare flag · true · false | Auto-strips transparent margin with a 1% fuzz. Useful when the source PNG has heavy padding (most perk + class icons). |
| bg | #RRGGBB · #RRGGBBAA · transparent | Background 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=webpThe 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