Finding Sprites

To find sprites on the sheet, follow these steps.

  1. Open a sprite sheet by clicking the Open button (or use Ctrl+O) and using the file selector to choose an image file.
  2. Choose a background filter from the drop down menu.
  3. Choose a connected criterion.
  4. Click the Find Sprites button, or use Ctrl+F
Controls for finding sprites

Controls for finding sprites

Background Filters

The background filter specifies the means by which the background is separated from the foreground when detecting objects.  The following background filters are available:

  • Same as top left pixel – under this filter, any pixel that matches the pixel in the top left corner of the sprite sheet is considered part of the background.  While this method is fast and works for most situations, it can mark some sections of sprites as the background erroneously.  For instance, if your sprite sheet consists of sprites placed on a pure white background, then any pure white section of a sprite will be considered part of the background, and your clipped sprite might get a hole in the middle.  If the sprite were a tire swing, then that would be fine, but if instead it was white letters over a colored background, then it might not be.

Connected Criterion

The connected criterion determines the method of finding and identifying groups of pixels against the background.  The following are available

  • 8 connectivity – Specifies that groups of pixel are connected if they are next to each other in up/down, left/right, or diagonal directions.  Given a pixel P, if there are no foreground pixels in the 8 locations surrounding P, then P is not connected to anything.
  • 8 conn. (3px HE) – Similar to plain 8 connectivity, but allows pixels to be separated by a small amount of background before they are considered unconnected.  Specifically, instead of examining a 1 pixel thick border around a pixel P like in plain 8 connectivity, a 3 pixel thick border is used.
  • 8 conn. (5px HE) – Just like the 3px version but with an even thicker border.

Find the Sprites

Clicking the Find Sprites button runs the algorithms specified by the selected background filter and connected criterion.  Sprites already identified on the sheet are discarded, and a new set of sprites is generated and displayed on the screen.  The new sprites have totally new identities when compared to the old sprites, even if they contain the exact same data.  Thus, you can get duplicates in your clipped sprites list if you Find Sprites, Clip a sprite, Find Sprites again, then Clip the same sprite.

Leave a Reply

Your email address will not be published. Required fields are marked *

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax

*
= 8 multiplied by 13