npx skills add ...
npx skills add unity-technologies/skills --skill sprite-segment-3x3grid
Analyze Sprite textures and output a 3x3 grid representation based on color matching. Segments a Sprite into a 3x3 grid, identifies the majority color of the center cell, and outputs a text pattern showing which cells match the center color. Use when analyzing sprite patterns, documenting sprite structure, or describing sprite color distribution.
npx skills add unity-technologies/skills --skill sprite-segment-3x3grid
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.
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%
.); otherwise it is not (X)| 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) |
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]
Example 1: Center matches top-left and bottom-right only
Grid interpretation:
Example 2: Center matches all surrounding cells
Example 3: Center matches none of the surrounding cells
Example 4: Center matches bottom row only
For the center cell:
For each of the 8 surrounding cells:
matchingPixels / totalPixels.); otherwise (X)When comparing pixel colors:
Use the Sprite's rect property to determine the pixel region to analyze:
sprite.rect.x, sprite.rect.y for the originsprite.rect.width, sprite.rect.height for dimensionsCode Template: "scripts/SpriteGridAnalysis.cs"