Sprite Segment 3x3grid
Segments a Sprite texture into a 3x3 grid and outputs a pattern of cells matching the...
Install
npx skills add Unity-Technologies/skills --skill sprite-segment-3x3grid -g -a claude-code -y- Repository
- Unity-Technologies/skills1.2k
- Category
- Engineering
- Updated
- 5d ago
- License
- See repository
- Context cost
- Lightabout 1,154 tokens
- Runs scripts
- No, instructions only
What it does
Segments a Sprite texture into a 3x3 grid and outputs a pattern of cells matching the center cell's color. Use when the user asks to analyze or document a sprite's structure or color distribution.
Sprite Color Grid Analysis
Purpose
This skill analyzes Sprite textures by segmenting them into a 3x3 grid and outputting a text representation based on color matching with the center cell.
Parameters
Match Threshold
The match threshold determines what percentage of pixels in a non-center cell must match the center's majority color for that cell to be considered a "match" (.).
| Threshold | Description | Use Case |
|---|---|---|
| 50% | At least half the cell's pixels match center color | Lenient matching for sprites with mixed regions |
| 75% | At least three-quarters match center color | Moderate matching for mostly solid regions |
| 90% | Nearly all pixels must match center color | Strict matching for very uniform sprites |
Default: 75%
Algorithm
- Segment the Sprite: Divide the Sprite's texture region into a 3x3 grid (9 cells total)
- Identify Center Color: Calculate the majority (most frequent) color in the center cell (position [1,1])
- Compare Each Cell: For each of the 8 surrounding cells, calculate what percentage of pixels match the center's majority color. If the percentage meets or exceeds the match threshold, the cell is a match (
.); otherwise it is not (X) - Generate Output: Create a text representation using the legend below
Output Legend
| Symbol | Meaning |
|---|---|
X | Cell does NOT meet the match threshold (insufficient pixels match center color) |
. | Cell MEETS the match threshold (enough pixels match center color) |
* | The center cell itself (always position [1,1] in the grid) |
Output Format
The output is a single line with three groups of three characters, separated by /. Each group represents one row of the grid.
Order: Top to Bottom rows, Left to Right within each row.
Format: [TopRow] / [MiddleRow] / [BottomRow]
Each row contains 3 characters separated by spaces: [Left] [Center] [Right]
