Generate a circular framed token icon with alpha transparency from a character portrait, suitable for VTTs and Obsidian embeds.
Generate circular framed token icons with alpha-transparent backgrounds from existing character portraits. Suitable for VTTs and Obsidian embeds.
Before proceeding, invoke /loreduck:shell-environment to learn about the shell
commands available in this skill and the environment they run in.
Before writing ANY file to loreduck/ — images or other assets — check whether
a file with the intended name already exists. If it does, append a version
suffix before the extension:
Penguin Mage (Token Icon).webp already exists → save as Penguin Mage (Token Icon) v2.webpPenguin Mage (Token Icon) v2.webp already exists → save as Penguin Mage (Token Icon) v3.webpUse ls loreduck/ or Glob to check before writing.
Styleguides live in loreduck/styles/ and are created via the
loreduck:styleguide skill. The default styleguide is a symlink at
loreduck/styles/default.
Use the default styleguide for token generation unless:
loreduck/styles/<name>/loreduck/styles/default is missing)When a styleguide applies:
textual-guide.md) and extract the Prompt
Fragment from the bottom of the file.When no styleguide is available, rely on the character context alone to guide the frame's visual treatment.
Craft the prompt. Build a detailed prompt for the framed token. The prompt must address four concerns:
Circular containment — The most critical constraint. The generated image must be a clean, unbroken circle with absolutely nothing extending beyond its boundary. State this explicitly and emphatically in the prompt:
Character-informed frame design — The frame should not be generic. Its material, motifs, and ornamentation should incorporate or complement the character's narrative identity. Draw on:
The frame should feel like it belongs to the character — an artifact of their world, not a stock border. For example:
Character composition — The character must be pleasingly framed within the circle. The prompt should specify:
Styleguide alignment — If a styleguide applies (see Styleguide Integration), incorporate its prompt fragment so the frame's rendering style is consistent with the established visual identity.
Generate the framed token. Use modify_image with the character's
existing portrait as the source image, a 1:1 aspect ratio, and the prompt
crafted above:
modify_image "<portrait>" \
"<prompt>" \
"<output>" "1:1"
The prompt should follow this structure:
Transform this portrait into a circular token icon. Frame the character's
head and shoulders inside an ornate circular frame. The character must be
pleasingly composed within the frame — their full head, face, and shoulders
must be visible with comfortable space between them and the inner edge of
the frame. Do not crop or cut off any part of the character, especially
the top of the head. Center the character naturally within the circle.
CRITICAL: The circular frame must have a perfectly clean, unbroken circular
silhouette. ALL elements — frame ornamentation, decorative flourishes, and
the character itself — must be strictly contained within the circle. Nothing
may extend beyond the circular boundary. No flourishes, tendrils, weapons,
wings, horns, or other details may break out of or protrude past the frame
edge. The outer edge of the frame must form a smooth, continuous circle.
Frame design: [character-specific frame description — describe the frame's
material, motifs, and ornamentation as narrative elements drawn from the
character's race, class, faction, signature themes, and environment. The
frame should feel like an artifact of the character's world.]
[Styleguide prompt fragment, if applicable]
The background outside the circular frame must be solid, uniform, dark black
with absolutely no texture, variation, or stray marks.
Check for an existing file at <output> and version if needed (see
File Versioning).
Cut out the background. Run circle-crop to detect the frame boundary
and replace the dark background with alpha transparency:
circle-crop "<output>" "<output>"
{Name} (Token Icon).webp, saved to loreduck/![[{Name} (Token Icon).webp|256]]When the user invokes /loreduck:token, interpret $ARGUMENTS as containing:
If character context is sparse, read the character's note (if it exists in the vault) to gather additional narrative details for frame personalization.
Generate the token icon following the Procedure above, using the character context to craft a richly personalized frame description.