Desktop Pet Creator
Create pixel-art chibi desktop pet companions for Qwen Code's floating pet window.
Given any character name, generate a complete pet package with animated spritesheet
and place it in ~/.qwen/pets/ where Qwen Code auto-discovers it.
Prerequisites
- Python 3 with Pillow (
pip3 install Pillow). Check before running the script:
python3 -c "from PIL import Image; print('OK')" 2>/dev/null || echo "Pillow not installed — run: pip3 install Pillow"
Step 1: Identify the Character
Ask the user who they want as their desktop pet if not already specified.
Then research the character's visual appearance:
- Team/organization colors (e.g., McLaren papaya orange, Ferrari red)
- Outfit/uniform (racing suit, school uniform, armor, etc.)
- Distinguishing features (hair color/style, accessories, number, helmet)
- Personality traits (for animation style — energetic, calm, goofy, serious)
- Iconic items (steering wheel, lightsaber, guitar, etc.)
Use web search if needed. For well-known characters (F1 drivers, popular anime,
etc.), rely on training knowledge.
Step 2: Design the Color Palette
Define 8–12 colors for the character. All colors must be distinct and work at
small pixel scale (3× = 9 px details).
| Color Role |
Example (F1 Driver) |
Example (Anime) |
outfit |
Team color [255,135,32] |
Uniform [30,30,50] |
outfit_dark |
Darker shade |
Darker shade |
outfit_light |
Lighter shade |
Lighter shade |
skin |
Warm skin tone |
Skin tone |
skin_dark |
Shadow skin |
Shadow skin |
hair |
Character hair color |
Character hair color |
accent |
Number/logo color |
Eye color |
shoe |
Dark grey/black |
Shoe color |
Step 3: Generate the Spritesheet
Run the generation script. Always resolve the path relative to the skill's base
directory:
python3 <skill_dir>/scripts/gen_spritesheet.py \
--output ~/.qwen/pets/<character_id>/spritesheet.webp \
--config '{"colors":{...},"features":{...}}'
Atlas format: 1536×1872 px, RGBA, 8 cols × 9 rows, 192×208 px cells.
Animation rows:
| Row |
State |
Description |
| 0 |
idle |
Breathing + blinking (8 frames) |
| 1 |
running-right |
Running to the right (8 frames) |
| 2 |
running-left |
Running to the left (8 frames) |
| 3 |
waving |
Waving at user (8 frames) |
| 4 |
jumping |
Jumping celebration (8 frames) |
| 5 |
failed |
Sad/collapsed on error (8 frames) |
| 6 |
waiting |
Idle tapping (8 frames) |
| 7 |
running |
Generic running (8 frames) |
| 8 |
review |
Thinking/examining (8 frames) |
Step 4: Create pet.json
Write the manifest to ~/.qwen/pets/<character_id>/pet.json:
{
"id": "<character_id>",
"displayName": "<Display Name>",
"description": "<Short description — who is this character?>",
"spritesheetPath": "spritesheet.webp"
}
Rules:
id: lowercase, no spaces, URL-safe (e.g., piastri, satoru, goku)
displayName: The name shown in the UI (e.g., "Piastri", "五条悟", "悟空")
description: One short sentence describing the character
Step 5: Verify and Activate
- Confirm the files exist:
ls -lh ~/.qwen/pets/<character_id>/
- Open the spritesheet for the user to check:
open ~/.qwen/pets/<character_id>/spritesheet.webp
- Tell the user to activate: open Qwen Code Settings → Appearance → Pet
Companion, click Refresh, then select the new pet.
Design Guidelines
Chibi Proportions
- Head: ~40% of total height (big head = cute)
- Body: ~30% of total height
- Legs: ~25% of total height
- Scale: Each "pixel" in the art = 3×3 actual pixels (scale=3)
- Character center: approximately (96, 124) within the 192×208 cell
Drawing Order (back to front)
- Legs (behind body)
- Body / outfit
- Arms
- Head shape
- Hair (back layer)
- Hair (front/top layer)
- Face features (eyes, mouth, expression)
- Accessories (hat, helmet, glasses, etc.)
- Foreground details (number, logo, badge)
Animation Tips
- Idle: subtle Y bob (0 to −2 px) + blink every 3rd–4th frame
- Running: alternating leg offset (±4 px), body tilt (±2 px), arm swing
- Waving: one arm raised high, alternating frames
- Jumping: Y offset curve (0 → −30 → 0), arms up
- Failed: body tilt increases, then collapse to sitting pose
- Happy expression: curved eyes (∧ shape), blush marks on cheeks
- Sad expression: straight eyebrows, downturned mouth
Headgear Options (features.headgear)
cap · helmet · hat · hood · crown · horns · ears · halo · headband · none
Hair Styles (features.hair_style)
short · long · spiky · ponytail · bald
Extras (features.extras list)
glasses · scarf · tail · wings · number (set features.number) · logo · sweat_drop
Example Characters
F1 Driver (e.g., Piastri)
{
"colors": {
"outfit": [255, 135, 32],
"outfit_dark": [220, 110, 20],
"outfit_light": [255, 170, 80],
"hair": [120, 80, 40],
"accent": [30, 30, 30]
},
"features": {
"headgear": "cap",
"number": "81",
"extras": ["logo"]
}
}
Anime Character (e.g., Gojo Satoru)
{
"colors": {
"outfit": [30, 30, 50],
"outfit_dark": [20, 20, 35],
"outfit_light": [60, 60, 80],
"hair": [230, 230, 250],
"accent": [100, 180, 255]
},
"features": {
"headgear": "none",
"hair_style": "spiky",
"extras": ["glasses"]
}
}
Animal (e.g., Shiba Inu)
{
"colors": {
"outfit": [220, 170, 100],
"outfit_dark": [180, 130, 70],
"outfit_light": [240, 200, 140],
"hair": [220, 170, 100]
},
"features": {
"headgear": "ears",
"extras": ["tail"]
}
}
Troubleshooting
- Pet not showing: Click Refresh in Settings → Appearance → Pet Companion
- Colors look wrong: Check that RGB values are tuples, not hex strings
- Spritesheet too large: Must be under 5 MB (webp lossless usually ~8–50 KB)
- Animation jittery: Ensure all 8 frames per row are visually distinct but not jarring
1---2name: desktop-pet3description: Create pixel-art desktop pet companions for Qwen Code. Generates a customized chibi spritesheet (1536×1872, 8×9 grid) for any character the user names — F1 drivers, anime characters, celebrities, fictional characters, animals, etc. Use when the user says "desktop pet", "桌宠", "桌面宠物", "想要XXX当桌宠", "换个宠物", or similar.4---56# Desktop Pet Creator78Create pixel-art chibi desktop pet companions for Qwen Code's floating pet window.9Given any character name, generate a complete pet package with animated spritesheet10and place it in `~/.qwen/pets/` where Qwen Code auto-discovers it.1112## Prerequisites1314- Python 3 with Pillow (`pip3 install Pillow`). Check before running the script:1516```bash17python3 -c "from PIL import Image; print('OK')" 2>/dev/null || echo "Pillow not installed — run: pip3 install Pillow"18```1920## Step 1: Identify the Character2122Ask the user who they want as their desktop pet if not already specified.23Then research the character's visual appearance:2425- **Team/organization colors** (e.g., McLaren papaya orange, Ferrari red)26- **Outfit/uniform** (racing suit, school uniform, armor, etc.)27- **Distinguishing features** (hair color/style, accessories, number, helmet)28- **Personality traits** (for animation style — energetic, calm, goofy, serious)29- **Iconic items** (steering wheel, lightsaber, guitar, etc.)3031Use web search if needed. For well-known characters (F1 drivers, popular anime,32etc.), rely on training knowledge.3334## Step 2: Design the Color Palette3536Define 8–12 colors for the character. All colors must be distinct and work at37small pixel scale (3× = 9 px details).3839| Color Role | Example (F1 Driver) | Example (Anime) |40|---|---|---|41| `outfit` | Team color `[255,135,32]` | Uniform `[30,30,50]` |42| `outfit_dark` | Darker shade | Darker shade |43| `outfit_light` | Lighter shade | Lighter shade |44| `skin` | Warm skin tone | Skin tone |45| `skin_dark` | Shadow skin | Shadow skin |46| `hair` | Character hair color | Character hair color |47| `accent` | Number/logo color | Eye color |48| `shoe` | Dark grey/black | Shoe color |4950## Step 3: Generate the Spritesheet5152Run the generation script. Always resolve the path relative to the skill's base53directory:5455```bash56python3 <skill_dir>/scripts/gen_spritesheet.py \57 --output ~/.qwen/pets/<character_id>/spritesheet.webp \58 --config '{"colors":{...},"features":{...}}'59```6061**Atlas format:** 1536×1872 px, RGBA, 8 cols × 9 rows, 192×208 px cells.6263**Animation rows:**6465| Row | State | Description |66|---|---|---|67| 0 | idle | Breathing + blinking (8 frames) |68| 1 | running-right | Running to the right (8 frames) |69| 2 | running-left | Running to the left (8 frames) |70| 3 | waving | Waving at user (8 frames) |71| 4 | jumping | Jumping celebration (8 frames) |72| 5 | failed | Sad/collapsed on error (8 frames) |73| 6 | waiting | Idle tapping (8 frames) |74| 7 | running | Generic running (8 frames) |75| 8 | review | Thinking/examining (8 frames) |7677## Step 4: Create `pet.json`7879Write the manifest to `~/.qwen/pets/<character_id>/pet.json`:8081```json82{83 "id": "<character_id>",84 "displayName": "<Display Name>",85 "description": "<Short description — who is this character?>",86 "spritesheetPath": "spritesheet.webp"87}88```8990Rules:91- `id`: lowercase, no spaces, URL-safe (e.g., `piastri`, `satoru`, `goku`)92- `displayName`: The name shown in the UI (e.g., "Piastri", "五条悟", "悟空")93- `description`: One short sentence describing the character9495## Step 5: Verify and Activate96971. Confirm the files exist:9899```bash100ls -lh ~/.qwen/pets/<character_id>/101```1021032. Open the spritesheet for the user to check:104105```bash106open ~/.qwen/pets/<character_id>/spritesheet.webp107```1081093. Tell the user to activate: open Qwen Code **Settings → Appearance → Pet110Companion**, click **Refresh**, then select the new pet.111112## Design Guidelines113114### Chibi Proportions115116- **Head**: ~40% of total height (big head = cute)117- **Body**: ~30% of total height118- **Legs**: ~25% of total height119- **Scale**: Each "pixel" in the art = 3×3 actual pixels (scale=3)120- **Character center**: approximately (96, 124) within the 192×208 cell121122### Drawing Order (back to front)1231241. Legs (behind body)1252. Body / outfit1263. Arms1274. Head shape1285. Hair (back layer)1296. Hair (front/top layer)1307. Face features (eyes, mouth, expression)1318. Accessories (hat, helmet, glasses, etc.)1329. Foreground details (number, logo, badge)133134### Animation Tips135136- **Idle**: subtle Y bob (0 to −2 px) + blink every 3rd–4th frame137- **Running**: alternating leg offset (±4 px), body tilt (±2 px), arm swing138- **Waving**: one arm raised high, alternating frames139- **Jumping**: Y offset curve (0 → −30 → 0), arms up140- **Failed**: body tilt increases, then collapse to sitting pose141- **Happy expression**: curved eyes (∧ shape), blush marks on cheeks142- **Sad expression**: straight eyebrows, downturned mouth143144### Headgear Options (`features.headgear`)145146`cap` · `helmet` · `hat` · `hood` · `crown` · `horns` · `ears` · `halo` · `headband` · `none`147148### Hair Styles (`features.hair_style`)149150`short` · `long` · `spiky` · `ponytail` · `bald`151152### Extras (`features.extras` list)153154`glasses` · `scarf` · `tail` · `wings` · `number` (set `features.number`) · `logo` · `sweat_drop`155156## Example Characters157158### F1 Driver (e.g., Piastri)159160```json161{162 "colors": {163 "outfit": [255, 135, 32],164 "outfit_dark": [220, 110, 20],165 "outfit_light": [255, 170, 80],166 "hair": [120, 80, 40],167 "accent": [30, 30, 30]168 },169 "features": {170 "headgear": "cap",171 "number": "81",172 "extras": ["logo"]173 }174}175```176177### Anime Character (e.g., Gojo Satoru)178179```json180{181 "colors": {182 "outfit": [30, 30, 50],183 "outfit_dark": [20, 20, 35],184 "outfit_light": [60, 60, 80],185 "hair": [230, 230, 250],186 "accent": [100, 180, 255]187 },188 "features": {189 "headgear": "none",190 "hair_style": "spiky",191 "extras": ["glasses"]192 }193}194```195196### Animal (e.g., Shiba Inu)197198```json199{200 "colors": {201 "outfit": [220, 170, 100],202 "outfit_dark": [180, 130, 70],203 "outfit_light": [240, 200, 140],204 "hair": [220, 170, 100]205 },206 "features": {207 "headgear": "ears",208 "extras": ["tail"]209 }210}211```212213## Troubleshooting214215- **Pet not showing**: Click Refresh in Settings → Appearance → Pet Companion216- **Colors look wrong**: Check that RGB values are tuples, not hex strings217- **Spritesheet too large**: Must be under 5 MB (webp lossless usually ~8–50 KB)218- **Animation jittery**: Ensure all 8 frames per row are visually distinct but not jarring