Skip to content

feat: add png-exr-alpha float PNG false-unpremul witness#69

Merged
TMHSDigital merged 1 commit into
mainfrom
feat/png-exr-alpha-roundtrip
Jul 19, 2026
Merged

feat: add png-exr-alpha float PNG false-unpremul witness#69
TMHSDigital merged 1 commit into
mainfrom
feat/png-exr-alpha-roundtrip

Conversation

@TMHSDigital

Copy link
Copy Markdown
Owner

Summary

  • Ships examples/png-exr-alpha/ witnessing that float_buffer=True Image.save() to PNG writes RGBA16 and false-unpremultiplies as if associated-alpha, clamping straight-authored dark values at low alpha to white (closed-form RGB err 0.98 at (0.02, a=1/255)).
  • Controls: OpenEXR float round-trip (~3e-8), byte→PNG straight RGBA8, and EXR color_mode='RGB' dropping alpha to opaque.
  • Wired gallery.json, plugin manifest, smoke workflow, README/AGENTS/CLAUDE counts (21→22), ROADMAP (shipped + light-linking/VSE candidates), generated gallery pages.

API contract

Float images author straight RGBA via pixels. PNG save treats the buffer as associated, does c/a + clamp, stores 16-bit. Mid-tones/darks with c > a reload as white.

Falsification

Temporarily swapped the float→PNG model check to the byte straight-alpha expecter → exit 6, residual 0.9803922. Restored; check passes again.

Visual

Dual easel (PNG-mangled vs EXR-clean). Contact-sheet compared against armature-bend, damped-track-aim, bmesh-gear. EEVEE render locally on Blender 5.1.1.

Test plan

  • Check-only on Blender 5.1.1 (live) — measured values in README/CI logs
  • Check-only on Blender 4.5 LTS via blender-smoke CI (4.5 not installed locally; 4.4.3 informal pass only — not a 4.5 substitute)
  • EEVEE --output render + hero/preview webp
  • python scripts/build_gallery.py; inspected generated docs/gallery/index.html + detail <img alt> / witnesses (no dup/truncation artifacts on q16(...))
  • validate + manifest/count + drift + security + 4.5/5.1 smoke on PR

Made with Cursor

AI float scratch buffers routinely die on Image.save() to PNG — Blender
writes RGBA16 and unpremultiplies as if associated-alpha, clamping dark
straight values at low alpha to white (closed-form err 0.98). Ship the
contract beside OpenEXR and byte-PNG controls so it cannot quietly drift.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions github-actions Bot added documentation Improvements or additions to documentation ci labels Jul 19, 2026
@TMHSDigital
TMHSDigital merged commit 9a035bc into main Jul 19, 2026
9 checks passed
@TMHSDigital
TMHSDigital deleted the feat/png-exr-alpha-roundtrip branch July 19, 2026 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant