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§
- Action
Spec - One action entry in a grouping config file.
- Detect
Options - Options for detecting disconnected sprites from a transparent or filtered sheet.
- Detect
Output - Result returned by
detect_frames. - Frame
Record - One frame entry in a
SliceManifest. - GifOptions
- Options for exporting PNG frames as a GIF preview.
- GifOutput
- Result returned by
export_gif. - Group
Options - Options for regrouping sliced frames into named animation folders.
- Group
Output Summary - Result returned by
group_actions. - Grouped
Action Summary - Summary for one grouped animation action.
- Normalize
Options - Options for normalizing multiple frames onto a shared canvas and anchor.
- Normalize
Output - Result returned by
normalize_frames. - Process
Sheet Metadata - JSON-friendly metadata emitted by
process_sprite_sheet. - Process
Sheet Options - Options for postprocessing a magenta-backed sprite sheet into normalized frames.
- Process
Sheet Output - Output summary for
process_sprite_sheet. - Processed
Frame Info - Per-frame QC details emitted by
process_sprite_sheet. - Remove
BgOptions - Options for removing a connected background color and producing a transparent PNG.
- Remove
BgOutput - Result returned by
remove_background. - Slice
Manifest - Manifest written by
slice_sheetanddetect_frames. - Slice
Options - Options for slicing a regular sprite sheet into fixed-size frames.
- Slice
Output - Result returned by
slice_sheet.
Enums§
- AnchorX
- Horizontal anchor used by
normalize_frames. - AnchorY
- Vertical anchor used by
normalize_frames. - Component
Mode - Connected-component selection mode for per-cell cropping.
- Detection
Mode - Detection mode recorded in
SliceManifest. - Frame
Align - 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.