seedkin

Docs / Styles

Portraits Preview

Any seed's avatar, drawn as a 64x64 game-style portrait in a seeded scene: robots and people from the shoulders up with arms and clothes, animals sitting, monsters waving, and Sprites traced smooth. Each one is the same character as the seed's avatar.

The Botling for this seed as a portrait The Snoot for this seed as a portrait The Noggin for this seed as a portrait The Beastie for this seed as a portrait The Sprite for this seed as a portrait

Portraits are a Preview: a seed's portrait may change in a minor release, noted in the changelog, while its avatar never does. Pin the version if you need a portrait to stay put.

Every style's playground shows the seed's portrait under the avatar, with its code and downloads: try Botling, Snoot, Noggin, Beastie or Sprite.

Use

Each style has a portrait entry point of its own, so an app that only draws avatars never loads the portrait code.

import { duet, portrait, portraitDataUri } from 'seedkin/botling/portrait';

const svg = portrait(user.id, { animate: true });
const src = portraitDataUri(user.id, { size: 128 });

// Two seeds face to face in one 128x64 scene.
const pair = duet(user.id, friend.id, { holiday: 'halloween' });

Swap botling for snoot, noggin, beastie or sprite. A portrait reads the same traits as the seed's avatar; what the avatar doesn't say, such as clothes, gear and the scene, comes from the same seed salted another way, so it is the same every time too.

Options

OptionDefaultWhat it does
size256Height in pixels; a portrait is square and a duet twice as wide. The picture is 64 cells tall, so multiples of 64 stay crisp.
animatefalseBlinks, talks, wobbles, wags and flaps, in step with the seed's avatar. Holds still for anyone who prefers reduced motion.
holidaynonenewYear, valentines, stPatricks, fourthOfJuly, halloween or christmas: the style's holiday palette, and that holiday's scene behind.
palettethe seed'sOne of the style's PALETTES, by index, as the avatar's palette. A holiday wins over it; palette objects aren't taken yet.
elementthe seed'sSprites only: fire, water, earth, wind or space, as the avatar's element.
skinthe seed'sNoggins only: one of SKIN_TONES, by index, as the avatar's skin.
titlee.g. 'Robot portrait'Accessible name. null marks the image decorative.

Bad options throw a RangeError, as the avatars' do.

Size and weight

A portrait has far more detail than an avatar: about 25 to 120 KB of SVG, and 5 to 45 milliseconds to draw. An animated Sprite is the heaviest, since it draws four frames: up to about 220 KB, and around 100 milliseconds. That suits a profile page, a card or a game screen. For a list of hundreds of users, draw avatars.

Support future projects on Ko-fi