Files
AnyImage/openspec/specs/cutout-boundary-padding/spec.md
nan 076a8c90f1 Add specifications for two-times upscale and unified depth plane features
- Introduced the two-times upscale specification detailing requirements for unified output, fixed model presets, arbitrary dimensions, and consistent job behavior.
- Added scenarios for existing models, repeated upscale, and handling of alpha preservation.
- Created the unified depth plane specification outlining geometry modes, stable interface, and asset evaluation.
- Defined scenarios for mode switching, relief and camera preservation, and validation of delivered assets.
2026-09-17 17:19:05 +08:00

65 lines
3.8 KiB
Markdown

# cutout-boundary-padding Specification
## Purpose
TBD - created by archiving change pad-cutout-material-edges. Update Purpose after archive.
## Requirements
### Requirement: Cutout boundary mapping follows the structural interior
The system SHALL derive one local inward direction from the final Cutout threshold Mask without selecting among content-based donor candidates. For each boundary location it SHALL sample at Boundary Padding pixels along that inward direction and transport the sample through the inner boundary band, boundary and outer padding band.
#### Scenario: Outer and hole boundaries
- **WHEN** the final Cutout Mask contains an outer outline or a hole
- **THEN** its mapping points from that boundary into the adjacent filled Mask region
#### Scenario: Thin structure
- **WHEN** the configured inward distance would leave the current Mask along the same ray
- **THEN** the mapping stops at the last position inside that Mask without changing direction or searching another donor
#### Scenario: Undefined local direction
- **WHEN** a boundary-band location has no finite nonzero local inward direction
- **THEN** that location remains unchanged
### Requirement: Material and depth share the Cutout boundary mapping
The system SHALL apply the same structural mapping to the independent Cutout material Color Image and optional Depth Image after raw AI artifacts return and before material or geometry consumption. It SHALL scale the mapping to each target image resolution.
#### Scenario: Material padding
- **WHEN** Boundary Padding is positive
- **THEN** the material boundary band receives complete RGBA from its mapped internal location
#### Scenario: Depth padding
- **WHEN** a Depth Cutout has positive Boundary Padding
- **THEN** its boundary band receives camera Z and validity from the mapped internal location and camera X/Y are reconstructed for each target pixel from the original intrinsics
#### Scenario: Different resolutions
- **WHEN** material and Depth images have different dimensions
- **THEN** both mappings represent the same normalized Cutout boundary and proportional padding width
### Requirement: Boundary processing is isolated from source and AI data
The system SHALL preserve the source Image, original Cutout Mask, mesh geometry, UV coordinates, MoGe input, Normal output, intrinsics and reference depth. The server SHALL generate raw Cutout Depth without edge extension.
#### Scenario: AI Cutout
- **WHEN** Cutout requests Depth or Normal generation
- **THEN** MoGe processes the unpadded input and only the returned Color and Depth images receive client-side boundary processing
#### Scenario: Existing depth calibration
- **WHEN** client-side Depth padding changes boundary pixels
- **THEN** the original Metadata reference depth remains the Cutout calibration reference
### Requirement: Boundary Padding is configurable
The system SHALL expose `Boundary Padding` in Preferences under Cutout Tool as a pixel distance with a default of 2, a minimum of 1 and a maximum of 4. Each Cutout operation SHALL capture the current value and existing objects SHALL remain unchanged.
#### Scenario: Asynchronous preference change
- **WHEN** the preference changes after an AI Cutout starts
- **THEN** its response uses the value captured when that operation started
### Requirement: Processed images preserve their lifecycle
The system SHALL preserve existing Color and Depth precision, interpretation, ownership and cleanup behavior after client-side boundary processing.
#### Scenario: Successful creation
- **WHEN** a padded Cutout is created successfully
- **THEN** its processed independent Color and optional Depth Images are packed with their updated pixels
#### Scenario: Failed creation
- **WHEN** Cutout creation fails after loading either image
- **THEN** unowned Blender Images and temporary files are released by the existing cleanup path