Action Image
Detect Sprites
Automatically detects and extracts individual sprites from a sprite sheet by analyzing transparency or color channels. Uses flood-fill to find connected regions.
Node IDDetectSpritesAction
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
Source File Path sourceFilePath | string | Yes | — | The full path to the sprite sheet image (e.g., "C:/temp/spritesheet.png"). |
Output Directory outputDirectory | file_picker | Yes | — | The directory where detected sprites will be saved. |
Masking Channel maskingChannel | enum | Yes | alpha | The channel to use for sprite detection. 'alpha' uses transparency, others use color values. |
Detection Threshold threshold | integer min 0 , max 255 | Yes | 128 | Pixels above this threshold are considered part of a sprite. For alpha, 128 means semi-transparent or opaque. |
Minimum Sprite Width minSpriteWidth | integer min 1 | No | 1 | Minimum width in pixels for a detected sprite. Smaller regions are ignored. |
Minimum Sprite Height minSpriteHeight | integer min 1 | No | 1 | Minimum height in pixels for a detected sprite. Smaller regions are ignored. |
Padding padding | integer min 0 | No | 0 | Number of pixels to add around each detected sprite as padding. |
Output Format outputFormat | enum | Yes | png | The image format for the output sprites. |
Naming Pattern namingPattern | string | Yes | sprite_{index} | Pattern for naming sprites. Use {index}, {x}, {y}, {width}, {height} as placeholders. |
Start Index startIndex | integer min 0 | No | 0 | Starting index for {index} placeholder. |
Sort By sortBy | enum | No | position | How to sort detected sprites. 'position' sorts left-to-right, top-to-bottom. 'size' sorts largest first. |
Create Directory createDirectory | boolean | No | true | If true, creates the output directory if it doesn't exist. |
Overwrite Existing overwrite | boolean | No | false | If true, overwrites existing files in the output directory. |
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
Execute input0 | object | Yes | Triggers the sprite detection operation. |
Outputs
| Output | Type | Identifier | Description |
|---|---|---|---|
Sprite Paths output0 | list | sprite_paths | An array of file paths for all detected and extracted sprites. |
Sprite Count output1 | integer | sprite_count | The total number of sprites detected and extracted. |
Sprite Info output2 | list | sprite_info | Detailed information about each sprite (index, position, dimensions). |