Skills

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
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" (.).

ThresholdDescriptionUse Case
50%At least half the cell's pixels match center colorLenient matching for sprites with mixed regions
75%At least three-quarters match center colorModerate matching for mostly solid regions
90%Nearly all pixels must match center colorStrict matching for very uniform sprites

Default: 75%

Algorithm

  1. Segment the Sprite: Divide the Sprite's texture region into a 3x3 grid (9 cells total)
  2. Identify Center Color: Calculate the majority (most frequent) color in the center cell (position [1,1])
  3. 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)
  4. Generate Output: Create a text representation using the legend below

Output Legend

SymbolMeaning
XCell 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]

Read the whole SKILL.md on GitHub

More in Engineering