Loading...
Loading...
Generate game-ready sprites for the Claude Office Visualizer using Nano Banana MCP and ImageMagick. Uses 45-degree front/top-down perspective (NOT isometric) with retro 16-bit pixel art style. Includes validation step before processing and helper scripts for background removal.
npx skill4agent add paulrobello/claude-office office-spritemcpl call nanobanana generate_image '{
"prompt": "[OBJECT DESCRIPTION], front view with slight top-down angle, NOT isometric, pixel art style, retro 16-bit game sprite, isolated on solid magenta background #FF00FF, clean edges, no shadows on background, game sprite asset, centered composition, no text, no watermarks, simple design",
"output_path": "/Users/probello/Repos/claude-office/frontend/public/sprites/[NAME]_raw.png"
}'[OBJECT DESCRIPTION][NAME]cp "/Users/probello/nanobanana-images/temp_images/[UUID].png" \
"/Users/probello/Repos/claude-office/frontend/public/sprites/[NAME]_raw.png"# Using the helper script (recommended)
/Users/probello/Repos/claude-office/.claude/skills/office-sprite/scripts/process_sprite.sh \
/Users/probello/Repos/claude-office/frontend/public/sprites/[NAME]_raw.png \
/Users/probello/Repos/claude-office/frontend/public/sprites/[NAME].pngprocess_sprite.sh input.png output.png --legacyINPUT="/Users/probello/Repos/claude-office/frontend/public/sprites/[NAME]_raw.png"
OUTPUT="/Users/probello/Repos/claude-office/frontend/public/sprites/[NAME].png"
# Step 1: FFmpeg - remove purple hue pixels (R≈B, G low)
ffmpeg -y -i "$INPUT" \
-vf "geq=r='r(X,Y)':g='g(X,Y)':b='b(X,Y)':a='if(between(r(X,Y)-b(X,Y),-60,60)*lt(g(X,Y),r(X,Y)*0.7)*lt(g(X,Y),b(X,Y)*0.7)*gt(r(X,Y)+b(X,Y),100),0,alpha(X,Y))'" \
-update 1 -frames:v 1 /tmp/step1.png
# Step 2: ImageMagick - remove bright magenta shades
magick /tmp/step1.png -alpha set -channel RGBA \
-fuzz 20% -transparent "magenta" \
-fuzz 15% -transparent "#CC00CC" \
-fuzz 15% -transparent "#880088" \
-fuzz 15% -transparent "#660066" \
/tmp/step2.png
# Step 3: ImageMagick - remove dark purple edge pixels
magick /tmp/step2.png \
-fuzz 8% -fill none \
-opaque "rgb(32,0,31)" \
-opaque "rgb(34,0,31)" \
-trim +repage -strip \
"$OUTPUT"
# Verify transparency
magick "$OUTPUT" -format "Size: %wx%h, Opaque: %[opaque]" info:OfficeGameV2.tsx// Add texture state
const [spriteTexture, setSpriteTexture] = useState<Texture | null>(null);
// Load texture in useEffect
useEffect(() => {
const loadTextures = async () => {
try {
const texture = await Assets.load("/sprites/[NAME].png");
setSpriteTexture(texture);
} catch (e) {
console.warn("Failed to load sprite:", e);
}
};
loadTextures();
}, []);
// Render sprite with fallback to placeholder
<pixiContainer x={X_POS} y={Y_POS}>
{spriteTexture ? (
<pixiSprite
texture={spriteTexture}
anchor={0.5}
scale={SCALE_FACTOR}
/>
) : (
<pixiGraphics draw={drawPlaceholder} />
)}
</pixiContainer>scale={50/189}scale={0.26}furnitureManager.ts| Type | Width | Height | Notes |
|---|---|---|---|
| desk | 140px | 80px | With chair position |
| plant | 40px | 40px | Potted plant |
| watercooler | 50px | 50px | Water dispenser |
| filing_cabinet | 60px | 80px | Metal cabinet |
| couch | 120px | 60px | Office couch |
| table | 100px | 60px | Meeting table |
OfficeGameV2.tsx| Element | Approx Size | Notes |
|---|---|---|
| Wall clock | 88x88px | Analog clock face |
| Whiteboard | 330x170px | With todo display |
| Elevator | 128x160px | With doors |
| Safety sign | 140x100px | Days without incident |
/Users/probello/Repos/claude-office/frontend/public/sprites/[name]_raw.png[name].png-transparentOpaque: False