Skip to content
Pixel Portrait Maker

Pixel Portrait Maker

Pixel Portrait Maker (hereinafter the “Application”) is a free web app for building a pixel art character portrait from dozens of options and saving it as a PNG. Every portrait is a 64 by 64 pixel image, drawn in your browser, so there are no stored sprites and nothing is uploaded.

The live instance is available at https://pixel.spellware.dev.

  1. Open the page. It starts with a random portrait.
  2. Change any option, in any of the groups on the right. The portrait on the left updates as you move a slider.
  3. Select Download PNG to save it.

The first two groups, Face and Hair, are open when the page loads. Select the heading of any other group to open it, and select it again to close it. Each heading shows how many options the group holds.

There are 57 options, plus a transparent background switch, in ten groups. Where a choice has a “none” setting, it is counted below.

GroupWhat you can change
FaceSkin tone and tint, face width, jaw, ears, nose, blush and shoulders
Hair14 styles, colour, vividness, lightness, 5 fringes, 4 streak settings and the streak colour
Eyes8 shapes, colour, lightness, spacing, height, lashes, eyeshadow and its colour
Brows6 styles and 5 tones
Mouth9 expressions, 8 lipsticks and the height of the mouth
Face details7 facial hair styles and their colour, freckles, beauty marks, scars, face paint and its colour, age lines and piercings
AccessoriesGlasses and their colour, headwear and its colour and shade, earrings, jewellery metal and necklaces
Outfit8 styles, colour, lightness, 5 patterns and the pattern colour
Background8 styles, colour, lightness, accent colour, 4 frames and the frame colour
StyleThe outline: dark, a white sticker outline, or none

Options with names, such as hair style, move in steps, and the name of the current choice is shown beside the slider. Colour sliders run around the colour wheel.

Skin tone, hair colour and eye colour have a row of preset swatches under them. A hair or eye swatch sets every value that makes up that colour at once, so a single press gives you, for example, auburn hair. Every other colour slider has a row of eight general colours. Select a swatch to use it, then adjust the slider if you want a different shade.

The Seed box holds the text that the current random portrait was made from. The same seed always makes the same portrait, on any device. Select Randomise for a new one, or type a seed of your own and press Enter or leave the box to use it. Anything that you change by hand after that is yours, and the seed no longer describes it.

The randomiser is weighted. Optional extras such as glasses, scars and face paint are usually left off, and common choices such as smiles are more likely than rare ones.

Select Reset to return every option to its starting value.

Choose a size, then select Download PNG.

SizeScale
64 px (original)1
256 px4
512 px8
1024 px16
2048 px32

Every size is a whole number multiple of the original, so each pixel stays a crisp square and nothing is blurred. Turn on Transparent background to save the figure alone, with nothing behind it. Combined with the white sticker outline, that makes a sticker.

Select Copy share link. Anyone who opens the link sees exactly the portrait that you made, with every option as you set it. The portrait is carried in the part of the address after the #, so it is never sent to a server. You can also copy the address from your browser’s address bar, which always holds the current portrait.

If a link is damaged, or has values that are out of range, the Application replaces them with the starting values rather than showing a broken portrait.

The Application is a progressive web app. Your browser can install it from its address bar or menu, and an installed copy keeps working without a connection. The first visit must be online so that the files can be saved.

The page takes its header, footer and design from the shared SpellWare script. If that script has not loaded, for example on a very first offline visit, the Application falls back to plain styles and still works.

The Application is a static web app, built with TypeScript and Vite. It has no server, and every portrait is drawn in the browser.

Terminal window
pnpm install
pnpm dev

The dev server listens on port 8001.

CommandWhat it does
pnpm devStarts the Vite dev server
pnpm buildType-checks with tsc, then builds the app into dist/
pnpm previewServes the production build on port 8001
pnpm lintLints src with no warnings allowed
pnpm testRuns every test with coverage

Every part of the portrait is drawn directly on a 64 by 64 grid, in layers, from the hair behind the head to the accessories in front of it. Most parts are small bitmaps written as rows of text, where each character stands for a colour. The larger shapes, such as the head, the hair and the shoulders, are built from bands that are measured from the head outline.

The head outline is computed one row at a time from the face width and the jaw shape. The ears, the arms of the glasses, the beards, the hair and the mask that keeps facial features on the face all read the same measurements, so they line up whatever the settings.

src/core/portrait.ts stacks the layers in this order:

  1. Hair behind the head, with a strand texture.
  2. The hood, neck and clothing.
  3. The head.
  4. Facial hair.
  5. The ears, earrings and necklace.
  6. Freckles and age lines, then blush, nose, eyeshadow, brows, eyes and mouth, all kept on the head.
  7. Scars, face paint, moles and piercings, also kept on the head.
  8. Glasses, the front of the hair, then headwear.
  9. A one pixel outline around the whole figure.
  10. The background and frame, unless the background is transparent.

All settings live in one table, src/core/settingsData.ts. The types, defaults, controls, randomiser and share links are all derived from it, so a setting cannot be added to one and forgotten in another.

A share link stores each value by its position in base 36, separated by dots, for example #s=1m.0.2.0...&t=0, where t is the transparent background switch. Because values are stored by position, the order of settingKeys is part of every link that has ever been shared. New settings must only ever be added to the end of that list.

Each value is corrected on the way in. A missing, invalid or out of range value is replaced with its default, so a damaged link can never produce an impossible portrait.

A seed is hashed with FNV-1a and drives a mulberry32 generator, so the same seed gives the same portrait in every browser. Optional features carry a chance of being off, and a few controls favour their common choices. Skin, hair and eye colours are chosen from the same presets as the swatches, with the natural colours more likely than the unusual ones.

PathHolds
src/core/The drawing and settings logic. It uses no browser features and is fully unit tested
src/ui/The editor: the option groups and swatches, the preview, and the download and share link buttons
src/main.tsThe entry point
src/styles.cssStyles specific to this app
test/One Vitest spec for each area of src/core
public/The app icons

The Application does not use local storage, session storage or cookies. The current portrait lives only in the address after the #. The service worker keeps the application files in the browser’s cache so that it works offline, and it also caches the shared SpellWare script, artwork and fonts as they are fetched.

pnpm build writes a static site to dist/. nginx serves that directory at pixel.spellware.dev, as configured in the nginx-configs repository. The page, the service worker, its registration script and the manifest are sent with Cache-Control: no-cache, so an update always reaches an installed copy. The content hashed files, in assets/ and the worker’s runtime file, are cached for a year. An unknown path returns a 404 and is sent to the company 404 page.

index.html loads the shared SpellWare headers script from https://cdn.spellware.dev/headers/index.js, with no features excluded. It adds the SpellWare header and footer, the page metadata and icons, the community popup, and the services listed in the legal section below. The Application’s own styles use the shared design tokens, with a fallback for each, so that the page still looks right if the script cannot load. The Application sits inside <main>, which the script turns into the page card. The page title beside the logo is set with data-nhcarrigan-title on the html element.

The Application inherits SpellWare’s global legal documents:

  1. Privacy Policy: https://docs.spellware.dev/#/privacy
  2. Terms of Service: https://docs.spellware.dev/#/terms
  3. License: https://docs.spellware.dev/legal/license/

The Application has no accounts and no server side storage. It does not keep anything in your browser’s storage, and it never uploads a portrait.

DataKept
The portrait you are makingOnly in the address after the #, which browsers never send to a server
The files you saveOn your own device, where you choose to put them

Like our other websites, the page loads the shared SpellWare headers script, which loads the following services. A consent banner asks for your choices. Their use of your data is covered by the Privacy Policy and by each provider’s own terms. The portraits themselves are not sent to any of them.

ServicePurpose
Secure PrivacyThe cookie consent banner
Google AnalyticsMeasuring how the site is used
HubSpotSite tracking and the chat widget
Google AdSenseAdvertising
Tree-NationThe tree planting widget in the footer

The Application’s repository is private, and it does not accept code contributions. Feedback and bug reports are welcome in the #bug-reports and #feature-requests forum channels in our Discord community.

For maintainers, the project uses:

  • TypeScript with the shared ESLint and TypeScript configs, and a zero warnings policy.
  • Vitest for tests, with 100% coverage enforced on src/core.
  • pnpm for package management.
Terminal window
pnpm install
pnpm lint
pnpm test
pnpm build
  1. Add the default to defaultNumericSettings, and append its key to the end of settingKeys, in src/core/settingsData.ts.
  2. For a choice with names, add the names to src/core/options.ts.
  3. Add the control to src/core/controls.ts, in the group it belongs to. Give an optional extra a chance of being off.
  4. Draw it in the module for that part, and add any colour it needs to src/core/palette.ts.
  5. Add tests. The suite checks that every control has a default that is in range, that every option on every control renders without error, and, for most parts, that every choice looks different from the others.