How to Make D&D Tokens for Roll20 and Foundry from AI Portraits (Sizes, Transparency, Borders)

Quick answerFor Roll20, export square PNG tokens at 280x280 px per occupied grid square (560x560 for Large, 840x840 for Huge). For Foundry, 400x400 WebP is the de facto standard, or 512x512 for dynamic token rings. Prompt the AI portrait with a flat solid background, remove it, then add a border with a free tool like Token Stamp 2.

Getting from an AI-generated portrait to a working virtual tabletop token takes four steps: generate art that isolates cleanly, strip the background, stamp a border, and export at the pixel size your VTT expects. Each step is documented somewhere — Roll20's partner guidelines, Foundry's media docs, Midjourney's editor notes — but nobody connects them, so most people guess at sizes and fight blurry, badly cropped tokens mid-session.

This guide gives you the exact numbers for both platforms, the prompt phrasing that makes background removal trivial instead of painful, and the free tools that finish the job. Everything here works with portraits from Midjourney, DALL-E/ChatGPT, Stable Diffusion, Flux, or Leonardo — the pipeline is the same regardless of which generator made the art.

What size should tokens be for Roll20 vs Foundry?

The two platforms measure differently, so learn both sets of numbers.

Roll20 renders its grid at 70x70 px per square at 100% zoom, but its own art guidelines say to build tokens at 4x that — 280x280 px per occupied square — so they stay sharp when players zoom in. Scale by creature size:

  • Tiny, Small, Medium (1 square): 280x280 px
  • Large (2x2 squares): 560x560 px
  • Huge (3x3 squares): 840x840 px
  • Gargantuan (4x4 squares): 1120x1120 px

Use PNG for anything with transparency. Keep the canvas square even if the character isn't — Roll20 fills and snaps tokens to grid units, and non-square images get distorted or padded unpredictably.

Foundry VTT is resolution-independent (token size is set in grid units in the token config), so the file just needs enough pixels to look clean. Foundry's media optimization guide recommends 200-400 px square for a Medium or Large creature, and notes 400x400 has become something of an industry standard. Foundry also prefers WebP over PNG: it supports transparency at noticeably smaller file sizes, which matters when a scene loads 30 NPC tokens at once.

A practical default that serves both platforms: generate large, then export one 560x560 PNG master per character and downscale from there. Downscaling is free; upscaling a 280 px token to Huge is not.

How do you prompt an AI portrait that converts cleanly into a token?

Token conversion is won or lost at the prompt. Three choices make background removal a five-second job instead of a masking session:

1. Flat, solid, contrasting background. Ask for a single flat color that doesn't appear in the character — pale gray behind a dark figure, deep slate behind a pale one. Scenery, gradients, and bokeh all confuse background removers.

2. Tight framing with margin. A head-and-shoulders close-up or bust portrait reads best at token scale — a 280 px circle has no room for full-body detail, and faces are what players recognize. Ask for the subject centered with clear space on all sides so the circular crop doesn't amputate a shoulder or horn.

3. Clean edges. Wispy smoke, cast shadows, glowing auras, and stray hair strands are what background removers chew up. Cut them in the prompt, not in Photoshop.

Here's the pattern in a full prompt, built for a recurring city guard NPC:

Head-and-shoulders portrait of a grizzled human city guard, middle-aged, broken nose, short gray-flecked beard, steel kettle helm, chainmail coif over a padded gambeson, stern weathered expression, subject centered with clear space around the head, flat solid slate-gray studio background, soft even lighting, digital painting with clean crisp edges --ar 1:1 --style raw --no background scenery, cast shadows, smoke

The --ar 1:1 matters: both VTTs want square sources, and generating square beats cropping a 2:3 portrait later. The prompt generator composes this structure for you — pick a framing, a flat-background note, and a clean-edged art style, and the token-friendly scaffolding comes built in.

How do you get a transparent background when the generator can't make one?

Neither Midjourney nor ChatGPT outputs an alpha channel. Midjourney generates RGB pixels only, and ChatGPT renders every image onto a solid fill even when you explicitly ask for transparency. You always remove the background after generation — the prompt tricks above just make that removal clean.

Your options, roughly in order of effort:

  • Midjourney's web Editor: open the image on midjourney.com, use Smart Select or Erase on the background, and export the remaining region as a transparent PNG. No third-party tool needed.
  • Dedicated removers: remove.bg and similar one-click tools handle a flat-background bust portrait almost perfectly. Free tiers usually cap the output resolution, so check you're still above your target token size.
  • Photopea (free, browser-based): Select Subject or magic-wand the flat background, delete, export PNG. Full control when an automatic tool clips a horn or a braid.
  • Stable Diffusion users: the rembg extension for A1111/Forge strips backgrounds in-pipeline, so batches come out pre-cut.

One edge case worth knowing: semi-transparent effects like magical glow or smoke can't survive a binary keep/delete remover. If your character needs them, either paint them onto the token border later or skip them at the portrait stage — at 280 px nobody misses the aura.

Should you use portrait-style tokens or top-down tokens?

Two conventions exist, and mixing them on one map looks worse than either alone.

Portrait tokens (also called "pogs") show a bust or face inside a circular border, viewed straight on. They're what AI generators are good at, what players recognize across a table of eight NPCs, and what this whole pipeline produces. They don't indicate facing, which for most D&D 5e groups doesn't matter — facing rules are optional and rarely used.

Top-down tokens show the character from above, like a miniature seen from the ceiling. They look natural on battle maps and can show facing — Foundry's docs specify that top-down tokens should face directly south in the source image, since Foundry rotates from that baseline and has no correction for diagonal-facing art. The catch: image models are trained overwhelmingly on portraits and produce unreliable top-down character views. Prompting "top-down view of a dwarf fighter" usually returns a three-quarter angle or a miniature-photograph pastiche.

The practical answer: use portrait tokens for AI art. If your table wants top-down, buy or commission purpose-made top-down packs rather than fighting the model. A workable hybrid many groups use is portrait tokens for named characters and simple colored top-down shapes for generic mobs, so the recognizable faces pop against the crowd.

Which free tools add the border and export the finished token?

Once you have a transparent (or flat-background) portrait, a token stamp tool crops it to a circle, adds the ring, and exports at token dimensions.

Token Stamp 2 (rolladvantage.com/tokenstamp) is the fastest browser option: drag the image in, pan and zoom the crop, pick a border style and color, export a transparent PNG. No account, no watermark. It also accepts custom border images you upload. Border color is worth systematizing: many DMs use one ring color per faction or per creature type so players parse a crowded map at a glance.

Token Stamp 2 for Foundry is the same tool packaged as a free Foundry module. It embeds in the Prototype Token window, so you can build the token without leaving the actor sheet — the output lands directly on the actor.

TokenTool (RPTools) is a free desktop app for Windows, macOS, and Linux. Same drag-in, frame, drag-out workflow, and it's handy offline or when you're processing a folder of images in a sitting.

All three output square PNGs with transparent corners, which is exactly what both VTTs want. Set the export size before you start a batch — 280 px masters for Roll20, 400 px for Foundry — so every token in the set matches.

What do Foundry's dynamic token rings need from your art?

Foundry v12 added dynamic token rings: instead of baking a border into the image, Foundry draws the ring at render time and animates it — flashing on damage, pulsing on effects. If you use them, your art requirements change.

You supply a subject texture: the character cutout on full transparency, with no baked-in border. Foundry's specs for it:

  • 512x512 px for a Medium (1x1) creature, 1024 px for Large/Huge, 2048 px for Gargantuan — power-of-two sizes render slightly faster on most hardware
  • WebP or PNG; Foundry suggests WebP at 80% lossy quality as the best fidelity-to-size ratio
  • Composition rule: the ring is drawn starting about two-thirds out from the image center, so keep the character inside the inner two-thirds of the canvas. Anything extending into the outer third will "pop out" over the ring — a deliberate effect if a sword or horn crosses it, a mess if a shoulder does

This is the same transparent bust you'd feed Token Stamp, just exported bigger and without stamping a border. If you run Foundry v12 or later, it's worth skipping baked borders entirely: one clean 512 px subject texture works with any ring style, and you can restyle your whole roster from token settings without touching the art.

How do you batch tokens for a whole NPC roster?

A village's worth of tokens goes fast once you lock the variables that must stay constant and template the rest. Style drift is the batch-killer: ten NPCs in ten art styles look like clip-art from ten stores. Fix the framing, background, lighting, style, and parameters in a reusable suffix, and vary only the character description:

[character description] — subject centered with clear margin on all sides, flat solid pale-gray background, soft even front lighting, painterly digital art with clean edges --ar 1:1 --style raw --no scenery, cast shadows, fog

Filled in for one roster member:

Bust portrait of a wiry drow assassin, obsidian skin, cropped white hair, red eyes, matte black leather armor with a high collar, cold appraising stare — subject centered with clear margin on all sides, flat solid pale-gray background, soft even front lighting, painterly digital art with clean edges --ar 1:1 --style raw --no scenery, cast shadows, fog

The generator makes this mechanical: set the shared traits once — framing, lighting, art style, palette — and swap race and character type per NPC, so every prompt in the batch carries identical style scaffolding. Our NPC portrait guide covers making each occupation read instantly.

Then process in bulk: generate everything before cutting anything, background-strip the whole folder in one pass (rembg batches natively; Photopea and remove.bg process one at a time), and stamp every token in a single Token Stamp session with the same border settings and export size. For recurring NPCs you'll want more art of later, save each character's exact prompt text — repeating the wording verbatim is the cheapest consistency tool there is.

Frequently asked questions

What file format should VTT tokens be?
PNG for Roll20 — it supports the transparency tokens need and is what Roll20's art guidelines specify. For Foundry VTT, WebP is recommended: it supports transparency like PNG but produces much smaller files, which speeds up scene loading when many tokens are on a map. JPEG is unsuitable for tokens because it has no transparency support.
What is Roll20's grid size in pixels?
Roll20 renders grid squares at 70x70 pixels at 100% zoom. Token art should be built at four times that — 280x280 pixels per occupied square — so tokens stay sharp when players zoom in past 100% or when a GM enlarges a token on the map.
How big should a Large creature token be?
A Large creature occupies 2x2 squares, so in Roll20 the token image should be 560x560 pixels (280 per square). In Foundry you set the token to 2x2 grid units in its configuration and the image scales automatically; a source file around 400 to 800 pixels square keeps it sharp, or 1024 pixels if you use dynamic token rings.
Can ChatGPT or DALL-E generate a transparent background?
No. Images from the ChatGPT app are always rendered onto a solid background with no alpha channel, even if you ask for transparency — you sometimes get a checkerboard pattern painted as pixels instead. Ask for a flat solid background color instead, then remove it with remove.bg, Photopea, or another background remover before making the token.
Do VTT tokens need to be square?
Yes, keep the image canvas square even if the character art inside is not. Roll20 fills and snaps tokens to square grid units, so non-square images get stretched or padded. Foundry likewise expects square pixel dimensions for token files. Generate at a 1:1 aspect ratio or crop to square before exporting the token.
Can you sell AI-generated tokens on the Roll20 marketplace?
No. Since March 2023 the Roll20 Marketplace has not accepted standalone products that use AI-generated art, and DriveThruRPG has a similar restriction. Using AI tokens in your own private games is a different matter — that's between you and your table, and no VTT restricts what art you upload for personal play.
Can you use the same AI image for the character portrait and the token?
Yes, and it helps recognition at the table. Generate one high-resolution head-and-shoulders image, keep the full uncropped version as the character-sheet portrait or handout, and run a copy through background removal and a token stamp for the map token. Players then see the same face in both places.
Why do tokens look blurry in Roll20?
Usually the source image is too small — a 70-pixel token matches the grid at 100% zoom but pixelates the moment anyone zooms in. Rebuild the token at 280x280 pixels per occupied square. Blurriness can also come from upscaling a small export; always downscale from a larger master rather than enlarging a small one.
Open the generatorBrowse the library
How to Make D&D Tokens for Roll20 and Foundry from AI Portraits (Sizes, Transparency, Borders) — Arcane Portraits