P3: normalize int32 PIL I-mode values by dtype max instead of raw passthrough
P4: clamp alpha to [0,1] instead of min-max stretching
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
PIL's convert("RGB") silently truncates to 8-bit, destroying precision
for high bit depth TIFFs and PNGs. Bypass it for I;16/I/F modes by
reading directly into numpy and normalizing per detected bit depth.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Detect bit depth from original image mode before RGB conversion.
Fix double-normalization when normalize=True.
Preserve constant images instead of zeroing them.
Fix alpha mask tensor shape to match ComfyUI MASK type [B,H,W].
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>