Refactor image processing and cutout functionalities

- Updated the naming convention for upscaled images to include underscores and file extensions.
- Renamed properties related to cutout pixel size to point spacing for clarity.
- Adjusted alpha region calculations to use a half-alpha threshold for better accuracy.
- Enhanced the handling of foreground mesh masks to consider half-alpha values.
- Introduced new functions for unbounded selections and cutout images, ensuring proper handling of source and selection images.
- Improved test coverage for cutout functionalities, including bounds mapping and alpha preservation.
- Updated tests to reflect changes in naming conventions and functionality adjustments.
This commit is contained in:
2026-08-27 12:01:47 +08:00
parent 2b79a342b0
commit 6c8358f92f
27 changed files with 1058 additions and 223 deletions

View File

@@ -31,9 +31,9 @@ class WindowManager:
draw(menu, None)
def cutout_context(window_manager, pixel_size=32, normal_analysis=False):
def cutout_context(window_manager, point_spacing=32, normal_analysis=False):
settings = SimpleNamespace(
cutout_pixel_size=pixel_size,
cutout_point_spacing=point_spacing,
cutout_normal_analysis=normal_analysis,
)
return SimpleNamespace(
@@ -71,7 +71,7 @@ def test_cutout_pie_uses_four_semantic_shapes_in_cardinal_order():
def test_cutout_pie_passes_image_lasso_options_to_every_shape():
window_manager = WindowManager()
context = cutout_context(
window_manager, pixel_size=16, normal_analysis=True
window_manager, point_spacing=16, normal_analysis=True
)
source = cutout_source(size=(4096, 2048))