Pixel portal icons
Two formats, drawn tiny and scaled up 8x with hard pixel edges:
| Format | Grid | Output | Anatomy |
|---|---|---|---|
| Activity icon | 64x64 | 512 px GIF | portal and rotating ring, stars, ground shadow, mascot, one prop |
| Badge | 32x32 | 256 px GIF | spinning ring, ink separator, tinted face, one centred symbol |
Both are 16 frames at 100 ms, loop forever, have transparent corners and one shared palette.
scripts/pixelicons.py draws the frame, the ring and the stars, and writes the files, so an
icon is only the function that draws what is special about it. Needs Python with Pillow.
Workflow
- List the icons: a file name, the one thing each shows, and an accent colour. The accents
already in use are in
references/api.md; pick ones that stay distinct. - Open
examples/claude_set.pyand read the scene closest to what you need (the prop index inreferences/api.mdsays which is which). Copying its structure is the fastest way to match the style. - Write a scenes file in the user's project, not in this skill's folder:
from pixelicons import *
@activity("coffee", "#d9a066") # file name, accent
def coffee(c, t, a): # canvas, frame 0-15, accent colour
shadow(c)
sip = 6 <= t < 11
mascot(c, 15, 31, "happy" if sip else blink(t, (2,)), look=(2, 0), arms=(0, -4 if sip else 0))
top = 33 if sip else 38
c.box(42, top, 11, 11, WHITE)
c.rect(43, top + 1, 9, 2, a)
c.box(51, top + 3, 5, 5, WHITE)
for index in range(3): # steam rises and fades, one wisp after another
rise = progress(t, index * 5)
c.rect(44 + index * 3, top - 3 - rise * 12, 1, 3, mix(WHITE, DISC, rise))
@badge("streak", "#ff9a3d")
def streak(c, t, color):
flick = 1 if wave(t, 4) > 0 else 0
c.poly([(16, 6 + flick), (22, 16), (20, 23), (12, 23), (10, 16)], color, INK)
c.poly([(16, 13 + flick), (19, 19), (17, 22), (15, 22), (13, 19)], YELLOW)
- Render (
--only coffee,streakwhile iterating):
python "<skill folder>/scripts/pixelicons.py" render my_icons.py --out icons
- Read
icons/preview.png. It shows three moments of each icon and, at the right, the size people actually see. Fix anything that overlaps, clips or turns to mush when small, deal with the printed notes, and render again. - Show the user the preview and say where the GIFs are.
What makes the style
- Draw on the small grid only. The renderer scales with no smoothing. Anti-aliasing,
gradients and soft transparency break the pixel look, and GIF has no partial alpha anyway:
blend with
mix(colour, DISC, t). - One idea per icon. The mascot plus one prop that explains the activity. These are seen at about 60 to 120 px, so a second prop usually just becomes noise.
- Zones. Prop above the head (y 7 to 28) or beside it (x 34 to 55); mascot body top around y 22 to 33; ground shadow at y 52. Keep props within about 27 px of the centre (31.5, 31.5) so the ring stays clear.
- One accent per icon colours the ring and the prop's highlights. The mascot's colours never change; that is what makes a set look like a family.
- Solid shapes with ink outlines.
c.boxgives the outlined, clipped-corner panel used for nearly every prop. White isWHITE(slightly lilac), dark isINK. - Keep props light enough to see. The disc is nearly black, so
DARKandINKshapes vanish on it. Fill with the accent,WHITEorMETAL; save dark fills for things inside a bright outline (the terminal window) or in front of the mascot (the laptop). - Small, periodic motion. A one pixel bob, a one frame blink, and one thing that moves to
tell the story. For a clean loop use
wave(t, whole_cycles),progress(t, offset), or patterns whose period divides 16. A gear turnsTAU / teethper loop. A sequence that builds up (typing, ticking boxes) may reset if it reads as starting over. - Badges get one symbol about 14 px across, light on the tinted face. Give higher tiers
more life (sparkles, a second moving part,
ring_colors=RAINBOW).
The mascot
mascot(c, x=20, y=28, eyes="open", look=(0, 0), arms=(0, 0), squash=0, legs=0) draws a
24x16 body with its top-left at (x, y), arms reaching 4 px past each side and legs 5 px
below. x=20 centres it; use about 12 to 17 to make room for a side prop. Negative arm
values raise an arm. To have it hold something, draw the prop after the mascot so it covers
the lower body (see the laptop and book scenes).
For a different character, write your own draw function with a similar footprint, three body tones and 3x5 eyes, and keep everything else.
Using the icons
- Discord Rich Presence only animates images loaded from a public
httpsaddress; images uploaded in the Developer Portal show as stills. After editing a GIF, change its URL (?v=2) because Discord caches it. - For a GitHub README gallery,
<img src="coffee.gif" width="128">(badges 96) keeps pixels crisp. - Hosting them anywhere public is publishing: get the user's yes first. The mascot is a fan style close to Claude Code's, so label a public set as unofficial. Draw generic props (blocks, a cube, a gizmo) instead of company logos.