Skip to content

Add dry-run mode for destructive operations #12

Description

@willibrandon

Feature Request

Add dry_run: bool parameter to tools that modify sprites to preview changes without applying them.

Motivation

Users need to understand what will change before committing to destructive operations like palette quantization, layer flattening, or color mode conversion.

Proposed Solution

Add optional dry_run parameter to destructive tools. When enabled:

  • Tool analyzes and returns what would change
  • No modifications are made to the sprite
  • Output includes preview information

Tools to Support

High Priority:

  • quantize_palette - show color count reduction, sample colors
  • apply_auto_shading - show regions that would be shaded, color additions
  • flatten_layers - show which layers would be merged

Medium Priority:

  • crop_sprite - show crop dimensions
  • scale_sprite - show new dimensions
  • Color mode conversions

Example Usage

{
  "sprite_path": "sprite.aseprite",
  "target_colors": 16,
  "algorithm": "median_cut",
  "dry_run": true
}

Output:

{
  "success": true,
  "dry_run": true,
  "preview": {
    "original_colors": 42,
    "target_colors": 16,
    "colors_to_remove": 26,
    "sample_palette": ["#FF0000", "#00FF00", ...]
  }
}

Implementation Notes

  • Add dry_run field to input structs
  • Add preview or dry_run field to output structs
  • Perform analysis without modifying sprite
  • Document dry-run behavior in tool descriptions

Benefits

  • Safer workflows - users can preview before committing
  • Better understanding of tool behavior
  • Enables iterative parameter tuning

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions