Imported from forgefabrik/agent-bigbrother (
.agents/skills/pixel-art-exporter/SKILL.md). Install upstream withnpx skills add forgefabrik/agent-bigbrother --skill pixel-art-exporter. Copyright stays with the author.
Pixel Art Exporter
Overview
The Pixel Art Exporter Skill enables exporting pixel art sprites from Aseprite to various formats optimized for different use cases. This includes single images (PNG), animated GIFs, spritesheets, and JSON metadata for game engines.
Core Capabilities:
- Export single frames or entire animations as PNG images
- Generate animated GIFs with customizable timing and looping
- Create spritesheets in multiple layouts (horizontal, vertical, grid, packed)
- Generate JSON metadata for game engines (Unity, Godot, Phaser, generic)
- Scale exports with pixel-perfect upscaling (1x, 2x, 4x, etc.)
- Handle transparency, background colors, and frame-specific exports
When to Use
Invoke this Skill when the user:
- Wants to export or save: "export this sprite", "save as PNG", "generate a spritesheet"
- Mentions file formats: "PNG", "GIF", "spritesheet", "sprite sheet", "texture atlas", "JSON"
- Prepares for game engines: "export for Unity", "Godot spritesheet", "Phaser animation"
- Needs specific outputs: "export just frame 3", "create a tileset", "save each layer separately"
- Requests scaling: "export at 2x size", "scale up 4x", "upscale for retina displays"
- Wants animation exports: "make this into a GIF", "export the animation", "save all frames"
- Needs metadata: "include JSON data", "export with coordinates", "frame information"
Instructions
1. Exporting Single Images (PNG)
For static sprites or single frames:
-
Get Sprite Information First
Use mcp__aseprite__get_sprite_info to understand: - Current dimensions - Number of frames - Available layers - Color mode and transparency settings -
Export PNG with Transparency
Use mcp__aseprite__export_png: - file_path: Absolute path (e.g., "/path/to/output/sprite.png") - frame_number: Specific frame (0-indexed) or omit for current frame - layer: Specific layer name or omit for merged output - scale: Scaling factor (1, 2, 4, etc.) - default is 1 -
Export Options
- Transparent background: Default behavior, preserves alpha channel
- Specific background: Use layer visibility or flatten before export
- Single frame from animation: Specify frame_number parameter
- Specific layer only: Provide layer name to export just that layer
2. Exporting Animated GIFs
For animations intended for web or presentations:
-
Verify Animation Setup
Use mcp__aseprite__get_sprite_info to check: - Frame count (needs 2+ frames) - Frame durations (timing information) - Animation tags (if specific tag requested) - Sprite dimensions -
Export GIF
Use mcp__aseprite__export_gif: - file_path: Output path (e.g., "/path/to/animation.gif") - animation_tag: Optional - specific tag name to export - loop: true (infinite loop) or false (play once) - scale: Upscaling factor if needed -
GIF Optimization Considerations
- GIF format has 256-color limit - ensure palette is optimized
- Frame timing is preserved from Aseprite frame durations
- Transparency is supported but may have edge artifacts
- File size increases with dimensions and frame count
3. Creating Spritesheets
For game engines and texture atlases:
-
Understand Layout Requirements
Layout Types:
- Horizontal: All frames in a single row (good for scrolling animations)
- Vertical: All frames in a single column (good for CSS animations)
- Grid: Frames arranged in rows and columns (balanced dimensions)
- Packed: Optimized packing to minimize texture size (engine-specific)
-
Export Spritesheet
Use mcp__aseprite__export_spritesheet: - file_path: Output PNG path (e.g., "/path/to/spritesheet.png") - layout: "horizontal", "vertical", "grid", or "packed" - animation_tag: Optional - export specific animation only - scale: Upscaling factor - padding: Pixels between frames (default 0, common: 1-2) - include_json: true to generate metadata file -
JSON Metadata Structure When
include_json: true, creates a .json file with frame data -
Layout Selection Guidelines
- Horizontal: Best for web/CSS sprite animations, simple scrolling
- Vertical: Mobile-friendly, vertical scrolling animations
- Grid: Unity, Godot - balanced texture dimensions (power-of-2)
- Packed: Advanced engines with atlas support (Phaser, LibGDX)
4. Generating JSON Metadata
For game engine integration:
-
Metadata Formats by Engine
Unity:
- Use "grid" layout for Unity's Sprite Editor
- JSON provides frame coordinates for slicing
- Include padding to prevent texture bleeding
Godot:
- Use "horizontal" or "grid" layout
- JSON maps to AnimatedSprite frames
- Frame duration converts to FPS
Phaser:
- Use "packed" layout for optimal performance
- JSON follows Texture Packer format
- Supports trimmed sprites and rotation
Generic/Custom:
- Standard frame array with x, y, w, h coordinates
- Duration in milliseconds per frame
- Animation tag groupings
-
Export with Metadata
Always include JSON when exporting for game engines: - Set include_json: true in export_spritesheet - JSON file created with same name as PNG (different extension) - Contains frame positions, durations, and sprite metadata
5. Scaling Exports
Pixel-perfect upscaling for high-resolution displays:
-
When to Scale
- Retina/HiDPI displays: Use 2x or 4x
- Modern game engines: Export at native size, let engine scale
- Web: Export 2x and use CSS to scale down (sharper rendering)
- Print/marketing: Use 4x or higher
-
Scaling Best Practices
- Always use integer scaling (1x, 2x, 3x, 4x, not 1.5x)
- Maintain pixel-perfect sharpness with nearest-neighbor
- Scale before export, not after (prevents blurring)
- Consider file size vs. quality tradeoffs
-
Apply Scaling
Add scale parameter to any export: - mcp__aseprite__export_png: scale: 2 - mcp__aseprite__export_gif: scale: 4 - mcp__aseprite__export_spritesheet: scale: 2 -
Resolution Recommendations
- 1x: Original pixel art size, retro aesthetic
- 2x: Standard for modern displays, good balance
- 4x: High-resolution, marketing materials
- 8x+: Ultra-high-resolution, print, large displays
Export Workflows for Different Use Cases
Static Sprite for Web
- Get sprite info to verify single frame
- Export PNG at 2x scale with transparency
- Optimize PNG with compression tools if needed
- Provide HTML/CSS example for display
Character Animation for Game
- Verify animation has multiple frames and tags
- Export spritesheet with "grid" layout
- Include JSON metadata (include_json: true)
- Set appropriate padding (1-2 pixels)
- Scale if needed (typically 1x for engines)
- Provide code snippet for target engine
Icon Set Export
- If multiple layers, export each separately
- Use PNG format with transparency
- Scale to multiple sizes (16x16, 32x32, 64x64)
- Batch export all sizes
- Organize in output directory structure
Social Media GIF
- Verify frame timing is appropriate (100-200ms typical)
- Export GIF with loop: true
- Scale to 2x or 4x for visibility
- Check file size (optimize if >2MB)
- Suggest hosting platforms if needed
Tileset for Game Engine
- Verify tiles are uniform size (e.g., 16x16, 32x32)
- Export as grid spritesheet
- Set padding to 0 or 1 (depends on engine)
- Include JSON for tile coordinates
- Provide tile size and grid dimensions
Game Engine Integration
Unity Integration
Export Settings:
- Layout: "grid"
- Include JSON: true
- Padding: 1-2 pixels (prevents bleeding)
- Scale: 1x (Unity handles scaling)
Import Steps:
- Import spritesheet.png into Assets
- Set Texture Type to "Sprite (2D and UI)"
- Set Sprite Mode to "Multiple"
- Open Sprite Editor and use JSON coordinates to slice
- Create Animator Controller with sprite animation
Godot Integration
Export Settings:
- Layout: "horizontal" or "grid"
- Include JSON: true
- Scale: 1x
- Padding: 0-1 pixels
Import Steps:
- Import spritesheet.png to project
- Create AnimatedSprite node
- Create SpriteFrames resource
- Add frames from spritesheet
- Use JSON durations to set FPS
Phaser Integration
Export Settings:
- Layout: "packed" or "horizontal"
- Include JSON: true (Texture Packer format)
- Scale: 1x or 2x depending on game resolution
Import Steps:
- Place spritesheet.png and .json in assets
- Load as atlas in preload()
- Create sprite with atlas key
- Create animations from frame names
Technical Details
PNG Export Format
- Color Mode: RGBA (8-bit per channel)
- Transparency: Full alpha channel support
- Compression: PNG lossless compression
- Color Space: sRGB
- Bit Depth: 32-bit (8-bit per channel RGBA)
GIF Export Format
- Color Palette: Maximum 256 colors
- Transparency: Binary (on/off), no partial alpha
- Animation: Frame-based with per-frame timing
- Loop Control: Infinite or play-once
- Compression: LZW compression
Spritesheet Layouts
- Horizontal: width = frameWidth * frameCount, height = frameHeight
- Vertical: width = frameWidth, height = frameHeight * frameCount
- Grid: Balanced to create near-square texture
- Packed: Optimally packed to minimize wasted space
Metadata Structures
Standard frame format includes:
- filename: Logical frame identifier
- frame: Position and size in spritesheet (pixels)
- rotated: Whether frame is rotated 90°
- trimmed: Whether transparent pixels were removed
- spriteSourceSize: Position within original canvas if trimmed
- sourceSize: Original canvas size before trimming
- duration: Frame duration in milliseconds
Common Export Patterns
Pattern 1: Single Frame Export
- Get sprite info to verify frame exists
- Export PNG with desired frame and scale
- Confirm export with dimensions
Pattern 2: Full Animation GIF
- Verify sprite has multiple frames
- Export GIF with appropriate loop setting
- Report frame count and file size
Pattern 3: Game-Ready Spritesheet
- Check dimensions and frames
- Ask about target engine if not specified
- Export spritesheet with JSON metadata
- Report texture dimensions and frame count
Pattern 4: Specific Animation Tag
- Verify tag exists
- Export spritesheet or GIF with animation_tag parameter
- Confirm only tagged frames exported
Pattern 5: Multi-Resolution Export
- Export at scale: 1
- Export at scale: 2
- Export at scale: 4
- Organize files: sprite_1x.png, sprite_2x.png, sprite_4x.png
Pattern 6: Layer-Specific Export
- Get sprite info (get layer names)
- For each layer: export PNG with layer parameter
- Report all exported layers
Error Handling
File Path Issues
- Verify directory exists (create if needed)
- Check write permissions
- Use absolute paths, not relative
- Suggest valid path if user provides invalid one
Missing Frames or Tags
- Use get_sprite_info to verify available frames and tags
- List available options to user
- Ask user to clarify which frame/tag they want
- Don't attempt export until valid selection made
Large File Warnings
- Calculate approximate size based on dimensions and frame count
- Warn user before export if size exceeds thresholds
- Suggest alternatives: reduce scale, export fewer frames, use spritesheet
Format Limitations
- Explain format limitation clearly
- Suggest alternative format or approach
- Proceed with export noting the limitation
Scale Factor Issues
- Only accept integer scale factors (1, 2, 3, 4, etc.)
- Warn if scale >4 (may create very large files)
- Explain pixel-perfect scaling benefits
- Suggest appropriate scale for user's use case
Success Indicators
Export completed successfully when:
- File Created: Output file exists at specified path
- Correct Format: File extension matches requested format
- Expected Dimensions: Scaled dimensions are correct
- Frame Count Match: Spritesheet or GIF contains expected number of frames
- JSON Generated: Metadata file created if include_json was true
- User Confirmation: User can open and verify exported file
Report to User:
✓ Export complete: /path/to/output.png
- Format: PNG with transparency
- Dimensions: 64x64 (2x scale from 32x32 original)
- Frames: 1 (static image)
- File size: ~8KB
[For spritesheets, also include:]
- Layout: Grid (4x2)
- Frame dimensions: 32x32 each
- Total frames: 8
- JSON metadata: /path/to/output.json
- Integration: Ready for Unity/Godot import