Skip to main content

Crate sprite_slicer

Crate sprite_slicer 

Source
Expand description

sprite-slicer provides file-oriented helpers for common 2D sprite-sheet workflows.

It supports:

  • slicing a fixed sprite grid into frames
  • detecting sprites from a transparent sheet
  • grouping frames into actions
  • exporting GIF previews
  • removing a connected background color
  • normalizing frames onto a shared canvas

Structs§

ActionSpec
One action entry in a grouping config file.
DetectOptions
Options for detecting disconnected sprites from a transparent or filtered sheet.
DetectOutput
Result returned by detect_frames.
FrameRecord
One frame entry in a SliceManifest.
GifOptions
Options for exporting PNG frames as a GIF preview.
GifOutput
Result returned by export_gif.
GroupOptions
Options for regrouping sliced frames into named animation folders.
GroupOutputSummary
Result returned by group_actions.
GroupedActionSummary
Summary for one grouped animation action.
NormalizeOptions
Options for normalizing multiple frames onto a shared canvas and anchor.
NormalizeOutput
Result returned by normalize_frames.
ProcessSheetMetadata
JSON-friendly metadata emitted by process_sprite_sheet.
ProcessSheetOptions
Options for postprocessing a magenta-backed sprite sheet into normalized frames.
ProcessSheetOutput
Output summary for process_sprite_sheet.
ProcessedFrameInfo
Per-frame QC details emitted by process_sprite_sheet.
RemoveBgOptions
Options for removing a connected background color and producing a transparent PNG.
RemoveBgOutput
Result returned by remove_background.
SliceManifest
Manifest written by slice_sheet and detect_frames.
SliceOptions
Options for slicing a regular sprite sheet into fixed-size frames.
SliceOutput
Result returned by slice_sheet.

Enums§

AnchorX
Horizontal anchor used by normalize_frames.
AnchorY
Vertical anchor used by normalize_frames.
ComponentMode
Connected-component selection mode for per-cell cropping.
DetectionMode
Detection mode recorded in SliceManifest.
FrameAlign
Vertical placement policy for sprite-sheet postprocessing.

Functions§

detect_frames
Detect disconnected sprites from a transparent or filtered sprite sheet.
export_gif
Export one PNG or a directory of PNG frames into a preview GIF.
group_actions
Regroup frames from a manifest into named animation folders.
normalize_frames
Normalize one PNG or a directory of PNG frames onto a shared canvas.
process_sprite_sheet
Postprocess a magenta-backed sprite sheet into normalized transparent frames, a recomposed transparent sheet, a GIF preview, and QC metadata.
remove_background
Remove a connected background color and save the result as a transparent PNG.
slice_sheet
Slice a regular sprite sheet into fixed-size PNG frames.