Skip to content

Atlas & Sprites

Sharp Stock provides professional texture atlas (Atlas / Plist) and sprite sequence (Sprites) management tools for 2D game developers, deeply optimizing the art slicing and packing workflow experience.

1. Atlas Resource Management (Atlas / Plist)

Atlases are a key solution for optimizing performance in 2D games. Sharp Stock supports deep parsing, sub-region preview, and reverse-slicing for various mainstream atlases.

Core Features

  • Intelligent Slicing Tools:
    • Alpha Slicing: Automatically analyzes image transparency to intelligently identify and extract individual sprite files.
    • Config-based Slicing: Reads .plist / .atlas description files exported from Cocos or TexturePacker to precisely restore the original boundaries and names of all sub-regions.
    • Auto Cutout / Slice: Supports solid background removal, visual boundary adjustments, and parameter filter constraints for sprite sheet matting and slicing.
  • Interactive Sub-region Preview: In the right detail panel, you can use the dropdown list or previous/next buttons on the toolbar to view all sub-regions contained within the atlas. The preview area supports zooming and dragging, and provides an automatic rotation mode.

2. Auto Cutout / Slice & Background Removal Guide

Auto Cutout / Slice

If you have a sprite sheet with an opaque background (e.g., black or white backing) or want to fine-tune filtering parameters and preview cuts before slicing, you can use the Auto Cutout / Slice feature.

Step-by-Step Guide

  1. Open the Dialog: Right-click the target image asset in the main view and select "Auto Cutout / Slice". A full-screen interactive dialog will open. Close it with the × button in the settings panel header, Esc, or Cancel at the bottom.
    • Use the buttons in the top-left of the preview area to switch the backdrop: Transparent (checkerboard), White, or Black (default: transparent).
    • Hold for original: Press and hold to view the unprocessed image; release to return to the live preview.
  2. Background Removal Settings:
    • Check "Background Removal". If the image lacks an alpha channel, this is enabled by default.
    • Eyedropper Color Picker: Click the eyedropper icon, then click anywhere on the background color in the left preview canvas. The system will extract that pixel's color values.
    • Removal mode:
      • Connected flood (recommended): Removes only background connected to the canvas edges; preserves same-color pixels inside sprites.
      • Global flood: Removes all similar colors across the image when needed.
    • Tolerance Threshold: Drag the slider (0 - 255). Uses RGB Euclidean distance (Magic Wand–like). Higher values widen the similar-color range. The preview updates in real time.
    • Edge feather (optional): Set a radius (1–20 px) to soften edges in preview and exports. Split bounding boxes still use hard edges.
    • Save Transparent Image: Checked by default, this saves the background-removed full image as <original_name>.transparent.png. Opaque formats like .jpg are automatically converted to .png. You can uncheck this if you do not want to save the full background-removed sheet.
  3. Image Splitting & Filtering Constraints:
    • Check "Image Splitting". The preview canvas on the left will display real-time bounding boxes around detected sprite islands.
    • Sprite Merge Method: Choose one of the following methods:
      • By Distance (Recommended): This is the default. “Nearby Sprite Merge Distance” controls whether disconnected content belongs to one slice. At 0px, only pixels that are actually connected are treated as one sprite, so disconnected content remains separate even when its slice boxes overlap. Increase the value for disconnected parts such as a character body, weapon, or effect. Regions are grouped when the shortest transparent gap between their edges is within the selected distance. Start with a small value and confirm the live boxes.
      • BoundingBox Overlap: Preserves the previous splitting behavior. Sprites are grouped whenever their rectangular bounds overlap, without checking the actual pixel gap. The distance slider remains visible but is disabled while this method is selected.
    • Use AI Matting Model (model name) (optional): After pre-slicing, process every slice with the currently selected downloaded local AI matting model for more precise background removal. The option and every processing stage show the model name. This is useful for complex edges that color tolerance alone cannot handle. The option is disabled until the selected model is downloaded; select Open AI Settings beside it to go directly to the download settings.
    • Lite / Demo asset limit: After you confirm, Sharp Stock calculates the new transparent full image and every planned slice before writing files or running AI inference. The same rule applies with or without AI matting. If the transparent full image conflicts, you can replace it or keep both with automatic renaming. A choice that would push the library above 100 assets opens the upgrade prompt.
      • When Background Removal is enabled, content belonging to another sprite inside the current slice bounds is replaced with the selected background color before inference.
      • When Background Removal is disabled, that unrelated content is replaced with transparency. The original backing color inside the slice is preserved so the model can evaluate the foreground edge.
      • After you select Confirm, a full-screen progress view shows the current stage, processed slice count, and percentage. On both Mac and Windows, slices are processed sequentially on the CPU. Each slice runs in a separate background process, and Sharp Stock waits for that process to exit before starting the next slice. This reliably releases the model's native memory after every image and prevents memory from accumulating during long tasks.
    • Size Constraints: Enable this to specify "Min Width/Height" and "Max Width/Height" bounds. Slices falling outside this range (e.g., tiny color artifacts or large text blocks) will be automatically filtered out.
    • Aligned Height: Check "Aligned Same Height" to force all exported slices to match a uniform height.
  4. Save & Export:
    • Click "Confirm" in the bottom-right corner. The processor will generate and save the transparent sheet and/or individual sliced images to the same directory as the original asset, then refresh the asset library.
    • Note: The "Confirm" button is disabled if neither background removal output nor sprite slicing is selected.
    • Development input inspection: Development builds retain the temporary model inputs under the app data folder at debug/auto-slice-ai-inputs. Production builds remove these temporary files.

Conflict & Overwrite Handling

  • Opaque Background-Removed Image Conflict: If the generated transparent image file (e.g., <original_name>.transparent.png) already exists in the target folder, the system will prompt a yellow warning confirmation dialog and display the specific target filename, asking whether to overwrite the existing file.
  • Slice Filename Auto-incrementing: When exporting sliced small images, the system automatically checks for the maximum suffix index (e.g., sprites-0005.png) in the target directory. Newly generated slices will use consecutive incremented index suffixes (e.g., starting from sprites-0006.png), renaming them by default to prevent overwriting existing slices.

3. Virtual Sprite Assets (Sprites)

"Sprites" is a core virtual asset concept introduced by Sharp Stock. It aims to aggregate scattered sprite image sequences (e.g., run_01.png, run_02.png) on the physical disk into a single logical object.

Core Advantages

  • Maintain Grid Cleanliness: Consolidates hundreds of tiny frame images into a single "Sprites" card, significantly reducing visual noise in the main view.
  • Interactive Simulation Playback: Supports directly loop-playing sequences in the asset card or preview viewport to review animation smoothness in real-time.

Operation Guide

  • One-click Merge: Select multiple individual images -> Context Menu -> Select "Merge to Sprites."
  • Deconstruct & Restore: If you need to edit individual frames, right-click and select "Deconstruct Sprites" to revert the aggregated item back into independent disk files.

4. Packing & Slicing Workflow

Sharp Stock integrates lightweight atlas generation features:

  • Automated Packing (Generate Atlas):
    • Select a "Sprites" asset or multiple individual images.
    • Right-click and select "Generate Atlas" or "Generate Plist."
    • The system will call a built-in Packing algorithm to output a compact large texture and accompanying coordinate configuration file for you.

5. Important Tips

  • Virtual Management Logic: Sprites are a logical view within the software. While they greatly facilitate management, the original images still exist on the physical disk in a specific metadata directory (automatically managed by the system).
  • Synchronization Suggestion: We recommend committing generated atlases to the SVN server promptly to ensure team members can share the latest atlas configurations.