Nitro Imager

Draws Habbo avatars, pets, furniture and group badges as images, with the client's own renderer.

Requests

RequestAnswers
GET /avatar?figure=…An avatar image. /avatarimage is the same, under the name Habbo's imager gives it.
GET /pet?type=…A pet image, from its figure string or its type.
GET /furni?name=…A furniture image, from its furnidata class name or id.
GET /badge/<code>.gifA group badge from its code; .png for a png.
GET /healthWhether it is up, and what it holds (json).

Every request is answered at the root and under /habbo-imaging/ too (/habbo-imaging/avatarimage?figure=…, /habbo-imaging/badge/…), the paths Habbo's own imager has, so a url built for it only needs its host changed. Every response carries Access-Control-Allow-Origin: *, so a page can draw the images into a canvas.

Avatars

GET /avatar takes Habbo's avatarimage parameters, and what the room draws besides. Only figure is required. A value that is not one of these is answered with 400 and what is wrong with it, never a guess.

ParameterValuesDefaultDraws
figuretype-set[-colour[-colour]] parts joined by dots, up to 512 charactersrequiredThe figure, as the hotel stores it: hd-180-1.ch-210-66.lg-270-82
genderM, FMWhich of a part's sets to draw where they differ
sizes, n, lnSmall (halved, as the zoomed-out room is), normal, or large (doubled)
direction0–72The body's direction, clockwise from 0 facing up-right: 2 faces down-right, 4 down-left, 6 up-left
head_direction0–7directionThe head's direction
headonly1offOnly the head, cropped to it
actionA comma list: one posture, expressions, and carry, use and sign actions (below)stdWhat the figure is doing: sit,wav, wlk,crr=6
gestureOne of the gestures belowstdThe face
dance0–40A dance; 0 is none
effect0–999990An avatar effect by its id; 0 is none
frame (or frame_num)0–10000Which frame of the animation a still image shows
animate1offEvery frame, as an animated gif at the room's 82 ms a frame
img_formatpng, gifpng; gif when animatedThe image's format. An animated image is always a gif
crop1offCut to the figure, the space around it gone but for a 1 px transparent gap; an animation to what any of its frames shows

A flag (headonly, animate, crop) is on when given with any value but 0 or false.

Examples

Actions and gestures

KindNamesUse
Posturestd wlk mv sit lay swim floatIn action, one at most: stand, walk (wlk or mv), sit, lay, swim, float
Expressionwav blow cry idle laugh respect ridejump sbollie sb360 sbup sbsq waveIn action, any number: wav is Habbo's name for wave
Item or signcrr cri drk usei sig signIn action, with an id from 0 to 9999: carry (crr=6), drink (drk=2), hold up a sign (sig=11)
Gesturestd spk eyb agr sad sml srpIn gesture, one: smile, sad, angry, surprised, spk talking, eyb eyes shut

Pets

GET /pet draws a pet as the room does: its library, palette, colour and custom parts, in a posture and with a gesture it has. A pet is named by its figure string or by type. A posture, gesture or palette the pet does not have is a 400 that lists the ones it does; a type the hotel has none of is a 404.

ParameterValuesDefaultDraws
figuretype palette colour, then the number of custom parts and each one's layer part palette, separated by spaces (+ in a url); up to 8 partsThe pet, as the hotel stores it: 15 2 ffffff 2 2 -1 0 3 -1 0 is a horse with two parts
typeA pet type's number or name (below)Instead of figure, with palette and color
palette0–9999, one the pet has0The pet's colouring: its breed
colorHexffffffA tint over the palette; ffffff is none
postureOne the pet has: std, sit, lay, mv (walking) …the pet's ownWhat it is doing
gestureOne the pet has: sml, agr, sad …noneIts face
head_direction0–7directionThe head's direction, for a pet that turns its head
headonly1offOnly the head
sizes, n, lnSmall (halved, as the zoomed-out room is), normal, or large (doubled)
direction0–72Which way the pet faces, as an avatar's; one it cannot face is drawn the nearest way it can
frame (or frame_num)0–10000How many steps into its animation a still image is
animate1offThe animation's loop, as a gif at the room's 41 ms a step, up to 64 frames
img_formatpng, gifpng; gif when animatedThe image's format

The hotel's pet types, by number: 0 dog 1 cat 2 croco 3 terrier 4 bear 5 pig 6 lion 7 rhino 8 spider 9 turtle 10 chicken 11 frog 12 dragon 13 monster 14 monkey 15 horse 16 monsterplant 17 bunnyeaster 18 bunnyevil 19 bunnydepressed 20 bunnylove 21 pigeongood 22 pigeonevil 23 demonmonkey 24 bearbaby 25 terrierbaby 26 gnome 27 gnome 28 kittenbaby 29 puppybaby 30 pigletbaby 31 haloompa 32 fools 33 pterosaur 34 velociraptor 35 cow 36 dragondog

Furniture

GET /furni draws a furniture item as the room does, from the hotel's furnidata and the item's library, in the state asked for. An item the furnidata does not have, or whose library is not there, is a 404.

ParameterValuesDefaultDraws
nameThe furnidata class name, with *<colour> for a coloured oneThe item: throne, rare_dragonlamp*4
idA furnidata idInstead of name: a floor item's, or a wall item's with wall=1
wall1offThe id is a wall item's: floor and wall items are numbered apart
state0–99990Which of its looks: a lamp on or off, a gate open or shut, and so its animation
sizes, n, lnSmall (halved, as the zoomed-out room is), normal, or large (doubled)
direction0–72Which way the item faces, as an avatar's; a floor item turns to 0, 2, 4 or 6 and a wall item to 2 or 4, as far as it has them
frame (or frame_num)0–10000How many steps into its animation a still image is
animate1offThe animation's loop, as a gif at the room's 41 ms a step, up to 64 frames
img_formatpng, gifpng; gif when animatedThe image's format

Group badges

GET /badge/<code>.gif (or .png) draws the badge the hotel stores for a group, the code the client hands to badge.asset.group.url and group.badge.url. A code is up to 5 six-character layers run together, bottom first:

LayerWrittenIs
Baseb part(2) colour(2) position(1)The badge's shape
Symbols part(2) colour(2) position(1)A symbol laid over it, parts 1–99
Symbolt (part − 100)(2) colour(2) position(1)A symbol, parts 100–199

The position is the cell of a 3×3 grid the part is centred on, 0–8 left to right, top to bottom: 4 is the middle. A layer that does not read is skipped and the rest still draw; a badge with no part that draws is a 404.

Try it

The avatar

A pet

The pet

A furniture

The furniture

A badge

The badge

Health

GET /health answers json: ok, the number of images cached (cached) and their size (cachedBytes), the avatar libraries loaded (avatarLibraries), the badge table's version (badgeTable), how many pet types it knows (petTypes) and furnidata items it has (furniture: floor, wall), and the process's memory (rss, heapUsed, external, in bytes).

Caching

ImageCache-Control
A complete avatarpublic, max-age=604800 (a week): everything it is drawn from is in its url
A pet or furniturepublic, max-age=86400 (a day): the hotel can update its library
A badgepublic, max-age=3600 (an hour): the hotel can retune its colours
An image missing a partno-store: a library that failed to load, or a set or effect that does not exist; drawn again next time

The imager also keeps encoded images in memory, the least recently used dropped first. Behind a CDN, cache by the full url, query string included.