Inputs and batch handling
- Garment photos
imgs/clothings/- New logo
imgs/logo/ · transparent RGBA PNG- Old-logo reference
imgs/logo2Find/ · optional- Completed images
imgs/output/ · existing results are skipped
Local backends
MLX SAM3 on Apple Silicon; PyTorch SAM3 with CUDA when available; an analytical OpenCV fallback.
Image-generation API charges and the wait for local image generation are avoided for each correction.
Detection and mask checks
Text grounding finds candidate labels. The minimum area can be configured down to 0.01% of the image. Care-label detections with more than 20% IoU overlap are excluded.
For the Wrangler labels, CIELAB and HSV checks identify warm yellow/gold lettering on dark patches. Mask refinement excludes supplementary text.
In occlusion mode, the overlap between label and fabric masks is removed from the replacement, with antialiased alpha edges.
Two application modes
Fit + composite: Lanczos resizing preserves the logo’s proportions, centres it in the detected box and applies alpha compositing.
Restore: reference letter shapes guide alignment; the old lettering is removed while retaining the label background, angle and fabric appearance.
Export: PNG or JPEG at quality 95. Optional debug images show detection boxes for visual inspection.