Tritone: Rec. 601 luminance, as After Effects

After Effects' Tritone weighs the working-space values with Rec. 601 (0.299,
0.587, 0.114), as its Tint does; EffectCraft used Rec. 709. Case 718 (red solid,
Highlights [1,1,0.8], Midtones [0.6,0.2,0.2], Shadows [0,0,0.3], Blend 25):
AE (132, 23, 46), EffectCraft was (113, 16, 49), now (132, 23, 46). On a grey
ramp (case 815) the shadows / midtones / highlights mapping already matched and
still does within 1/255. CPU and GPU (fx_color op 4).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
vangel76
2026-10-19 16:13:41 +02:00
co-authored by Claude Opus 5.5
parent fb16d5573e
commit 960f41d50b
5 changed files with 38 additions and 10 deletions
+2 -1
View File
@@ -167,7 +167,8 @@ fn fxc_point(@builtin(global_invocation_id) gid: vec3<u32>) {
case 4u: {
if (a > 0.0) {
let c = px.xyz / a;
let l = clamp(luminance(c), 0.0, 1.0);
// Rec. 601 weights, as effects::color_fx::tritone.
let l = clamp(dot(c, vec3<f32>(0.299, 0.587, 0.114)), 0.0, 1.0);
var t: vec3<f32>;
if (l < 0.5) {
t = fxc_mix(P.f[2].xyz, P.f[1].xyz, l * 2.0);
+1 -1
View File
@@ -605,7 +605,7 @@ fn pointwise(@builtin(global_invocation_id) gid: vec3<u32>) {
case 1u: {
if (a > 0.0) {
let c = straight(px);
// Rec. 601 weights, as After Effects (effects crate tint_luma).
// Rec. 601 weights, as After Effects (effects crate luma_601).
let l = clamp(0.299 * c.x + 0.587 * c.y + 0.114 * c.z, 0.0, 1.0);
let blk = P.f[0].xyz;
let wht = P.f[1].xyz;
+1 -1
View File
@@ -852,7 +852,7 @@ fn effects_whose_kernels_failed_render_on_the_cpu() {
}
/// The GPU Tint gives After Effects 2026's greys for full-frame solids at its defaults (sRGB
/// working space, not linearised): Rec. 601 weights, as the CPU (`color_fx::tint_luma`).
/// working space, not linearised): Rec. 601 weights, as the CPU (`color_fx::luma_601`).
#[test]
fn gpu_tint_defaults_match_after_effects_greys() {
let Some(g) = gpu() else { return };