← UnityCONTENT HISTORY

Update to Unity

Snapshot Sep 30, 2026 · 23:16 UTC · version 0.1.6-beta

Collection source: not recorded for this historical snapshot.

WHAT CHANGED · RULE-BASED ANALYSIS

First saved snapshot

No earlier snapshot is available to establish a change.

Compare saved observations

Download comparison JSON
Full technical diff · 0 changed fields
Full snapshot data
{
  "description": "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.",
  "included_files": [
    {
      "relative_path": "scripts/SpriteGridAnalysis.cs",
      "size_in_bytes": 4737
    }
  ],
  "name": "sprite-segment-3x3grid",
  "skill_md_contents": "---\nname: sprite-segment-3x3grid\ndescription: 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.\n---\n# Sprite Color Grid Analysis\n\n## Purpose\n\nThis skill analyzes Sprite textures by segmenting them into a 3x3 grid and outputting a text representation based on color matching with the center cell.\n\n## Parameters\n\n### Match Threshold\n\nThe **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\" (`.`).\n\n| Threshold | Description | Use Case |\n|-----------|-------------|----------|\n| **50%** | At least half the cell's pixels match center color | Lenient matching for sprites with mixed regions |\n| **75%** | At least three-quarters match center color | Moderate matching for mostly solid regions |\n| **90%** | Nearly all pixels must match center color | Strict matching for very uniform sprites |\n\n**Default**: 75%\n\n## Algorithm\n\n1. **Segment the Sprite**: Divide the Sprite's texture region into a 3x3 grid (9 cells total)\n2. **Identify Center Color**: Calculate the majority (most frequent) color in the center cell (position [1,1])\n3. **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`)\n4. **Generate Output**: Create a text representation using the legend below\n\n## Output Legend\n\n| Symbol | Meaning |\n|--------|---------|\n| `X` | Cell does NOT meet the match threshold (insufficient pixels match center color) |\n| `.` | Cell MEETS the match threshold (enough pixels match center color) |\n| `*` | The center cell itself (always position [1,1] in the grid) |\n\n## Output Format\n\nThe output is a single line with three groups of three characters, separated by ` / `. Each group represents one row of the grid.\n\n**Order**: Top to Bottom rows, Left to Right within each row.\n\n**Format**: `[TopRow] / [MiddleRow] / [BottomRow]`\n\nEach row contains 3 characters separated by spaces: `[Left] [Center] [Right]`\n\n### Grid Position Mapping\n\n```\nGrid Layout:        Output Order:\n[0,0] [1,0] [2,0]   1  2  3   -> First group\n[0,1] [1,1] [2,1]   4  5  6   -> Second group (5 is always *)\n[0,2] [1,2] [2,2]   7  8  9   -> Third group\n```\n\n### Examples\n\n**Example 1**: Center matches top-left and bottom-right only\n```\n. X X / X * X / X X .\n```\nGrid interpretation:\n```\n.  X  X\nX  *  X\nX  X  .\n```\n\n**Example 2**: Center matches all surrounding cells\n```\n. . . / . * . / . . .\n```\n\n**Example 3**: Center matches none of the surrounding cells\n```\nX X X / X * X / X X X\n```\n\n**Example 4**: Center matches bottom row only\n```\nX X X / X * X / . . .\n```\n\n## Implementation Guidance\n\n### Calculating Center's Majority Color\n\nFor the center cell:\n1. Sample all pixels within the cell's bounds\n2. Group pixels by color (consider using a color tolerance threshold for similar colors)\n3. The majority color is the color with the highest pixel count\n4. For tie-breaking, use the first color encountered\n\n### Matching Non-Center Cells\n\nFor each of the 8 surrounding cells:\n1. Count the total number of pixels in the cell\n2. Count how many pixels match the center's majority color (using color tolerance)\n3. Calculate the match percentage: `matchingPixels / totalPixels`\n4. If match percentage >= threshold, cell is a match (`.`); otherwise (`X`)\n\n### Color Tolerance\n\nWhen comparing pixel colors:\n- Consider using a tolerance threshold (e.g., RGB distance < 10) for \"matching\"\n- Alternatively, for sprites with limited palettes, exact matching may be appropriate\n- Account for alpha channel if relevant to the use case\n\n### Sprite Bounds\n\nUse the Sprite's `rect` property to determine the pixel region to analyze:\n- `sprite.rect.x`, `sprite.rect.y` for the origin\n- `sprite.rect.width`, `sprite.rect.height` for dimensions\n- Divide width and height by 3 to get cell dimensions\n\n## References\n\nCode Template: \"scripts/SpriteGridAnalysis.cs\"\n\n## Use Cases\n\n- **Documentation**: Describe sprite patterns in a compact text format\n- **Testing**: Verify expected sprite structure in automated tests\n- **Analysis**: Quickly identify sprites with similar color distributions\n- **Debugging**: Understand why sprites look different than expected\n- **Asset Cataloging**: Generate searchable metadata for sprite assets\n\n## Notes\n\n- This analysis works best with sprites that have distinct color regions\n- For sprites with gradients or many colors, consider increasing color tolerance\n- The Y-axis is flipped from Unity's texture coordinates to produce top-to-bottom output\n- Transparent pixels can be treated as a distinct \"color\" or ignored based on use case\n"
}

SHA-256 of public snapshot: 918aa69cb4fc0ab3bbded92a4a0eb49187049306374c359b9188b0be86efebd9