Skip to content

#750: float footage follows Working Gamma and is encoded once - #752

Merged
h-a-n-a-s-h-i merged 1 commit into
storytold:mainfrom
vangel76:gap-float-working-gamma
Oct 12, 2026
Merged

h-a-n-a-s-h-i merged 1 commit into
storytold:mainfrom
vangel76:gap-float-working-gamma

Conversation

@vangel76

Copy link
Copy Markdown
Contributor

Fixes #750.

Part of ranked gap #10 "Colour pipeline differences" (docs/gaps.md); the follow-up @Romasikkk reported on #495 after #645.

Problem

With no working space and Working Gamma 2.4, After Effects converts a linear EXR with a pure 2.4 power curve (0.18 → 0.490, 0.051 → 0.290). On main the setting reached Interpret As Linear Light but not float footage: MediaPool sRGB-encodes float values at decode, before the renderer knows the project's curve, so a linear EXR still came out at 0.18 → 0.4627. Turning on Interpret As Linear Light for the EXR then encoded a second time on top of the decode's own encoding (0.18 → 0.7255).

Fix

  • effectcraft-render: new FloatCurve (sRGB, a pure 2.4 power curve, or the stored linear values) and FootageSource::frame_with(item, footage, t, size, float). Its default calls frame / frame_at_size and ignores the curve, so sources without float footage don't change. Pipe::float_curve(f) picks the curve: the stored values when Interpret As Linear Light encodes them afterwards (once, with linear_footage_space), otherwise the Working Gamma's curve when unmanaged and sRGB when managed (the working space converts from there). The footage paths (plain, reduced size, separate fields, frame blending, comp proxies) ask through it. The frame-blend cache key includes the curve.
  • effectcraft-media: AlphaOp takes the curve instead of the Preserve RGB flag (Preserve RGB still reads the stored values, whatever is asked). MediaPool implements frame_with, and the decoded-frame cache key holds the curve, so each one decodes and caches separately. frame / frame_at stay sRGB.

Integer footage (8/16-bit) decodes the same way whatever the curve. Managed projects without Interpret As Linear Light don't change.

Tests

  • render::tests_color::float_footage_is_encoded_once_with_the_working_gamma: float footage at Working Gamma 2.4 / 2.2 and in an sRGB working space, each with Interpret As Linear Light off and on. It gives AE's values (0.290 / 0.490 / 0.749 at 2.4) and encodes once. It fails on main (2.4 gives 0.250 / 0.461 / 0.735).
  • media::pool::tests::float_exr_is_encoded_with_the_requested_curve: a float EXR decoded through MediaPool with each curve, plus Preserve RGB overriding the curve and separate cache entries for each curve.

Gates

  • cargo fmt --check
  • cargo clippy -j 4 -p effectcraft-render -p effectcraft-media --all-targets -- -D warnings
  • cargo test -j 4 -p effectcraft-render -p effectcraft-media (all targets): all pass
  • cargo xtask layers: ok
  • cargo check -p effectcraft-render -p effectcraft-media --target wasm32-unknown-unknown

The full cargo xtask ci was not run locally because the machine is shared.

What remains

🤖 Generated with Claude Code

Problem: with no working space and Working Gamma 2.4, a linear EXR still
converted with the sRGB curve (0.18 -> 0.4627, After Effects 0.4902):
float footage was sRGB-encoded at decode, before the render knew the
project's curve. Interpret As Linear Light on float footage then encoded
a second time (0.18 -> 0.7255).

Fix: FootageSource::frame_with asks for float footage with a FloatCurve
(sRGB, a pure 2.4 power curve, or as stored). The renderer asks for the
Working Gamma's curve when unmanaged, sRGB when managed, and the stored
values when Interpret As Linear Light encodes them afterwards.
MediaPool decodes float values that way (Preserve RGB still reads them
as stored) and caches each curve apart.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@echelon

echelon commented Oct 12, 2026

Copy link
Copy Markdown
Member

Merged. Thank you for the contribution, @vangel76!

If you haven't already, come join us on Discord: https://discord.gg/artcraft. It's the best place to discuss what you're working on next and to coordinate with other contributors.

h-a-n-a-s-h-i pushed a commit that referenced this pull request Oct 12, 2026
- Footage sources: the cancellable wrapper (#784) forwards frame_with (#752 float curves)
  and problem (#887); problem's default lives on the trait.
- Media: a called-off decode (#784) is not a footage problem (#887).
- Effect Controls rename (#953): Escape cancels (egui drops focus on Escape the same
  frame), the Rename item is translated; regression test.
- i18n (#873): drop the /out-i18n/ ignore rule and the note about an uncommitted script.
- Tests: text range selector caps (#926) re-borrow the layer; the RAM preview test (#793)
  sets the comp's own Resolution (#462).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Working Gamma 2.4 doesn't reach float footage (OpenEXR), and Interpret As Linear Light encodes float footage twice

3 participants