{"record":{"id":"93883e4a8b208c83","repo":"remotion-dev/remotion","slug":"gamma-must-be-max-gamma-but-got-json-st","errorCode":null,"errorMessage":"\"gamma\" must be <= ${MAX_GAMMA}, but got ${JSON.stringify(gamma)}","messagePattern":"\"gamma\" must be <= (.+?), but got (.+?)","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/effects/src/levels.ts","lineNumber":105,"sourceCode":"\n\tconst {blackPoint, whitePoint, gamma} = resolve(params);\n\tvalidateUnitInterval(blackPoint, 'blackPoint');\n\tvalidateUnitInterval(whitePoint, 'whitePoint');\n\n\tif (blackPoint >= whitePoint) {\n\t\tthrow new TypeError(\n\t\t\t`\"blackPoint\" must be less than \"whitePoint\", but got ${JSON.stringify(blackPoint)} and ${JSON.stringify(whitePoint)}`,\n\t\t);\n\t}\n\n\tif (gamma < MIN_GAMMA) {\n\t\tthrow new TypeError(\n\t\t\t`\"gamma\" must be >= ${MIN_GAMMA}, but got ${JSON.stringify(gamma)}`,\n\t\t);\n\t}\n\n\tif (gamma > MAX_GAMMA) {\n\t\tthrow new TypeError(\n\t\t\t`\"gamma\" must be <= ${MAX_GAMMA}, but got ${JSON.stringify(gamma)}`,\n\t\t);\n\t}\n};\n\nconst VERTEX_SHADER = /* glsl */ `#version 300 es\nin vec2 aPos;\nin vec2 aUv;\nout vec2 vUv;\n\nvoid main() {\n\tvUv = aUv;\n\tgl_Position = vec4(aPos, 0.0, 1.0);\n}\n`;\n\nconst FRAGMENT_SHADER = /* glsl */ `#version 300 es\nprecision highp float;","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/levels.ts#L87-L123","documentation":"Thrown by `levels()` when `gamma` exceeds MAX_GAMMA (10). Extremely large gamma values over-brighten midtones to the point of clipping the whole frame to white and offer no useful visual effect beyond the cap, so the validator rejects them.","triggerScenarios":"Passing `levels({gamma: 50})` or any value > 10; animating gamma with an unclamped `interpolate()` whose output exceeds 10.","commonSituations":"Slider pushed to maximum; exponential/easing curves that overshoot; multiplying gamma by a scale factor that pushes it past 10.","solutions":["Lower `gamma` to <= 10 (10 is already an extreme wash-out).","Clamp animated gamma with `extrapolateRight: 'clamp'` and an output max of 10.","Re-derive the gamma multiplier so the product stays within 0.01–10."],"exampleFix":"// before\nlevels({gamma: 25})\n\n// after\nlevels({gamma: 2.2})","handlingStrategy":"validation","validationCode":"const MAX_GAMMA = 10;\nif (typeof params.gamma === 'number' && params.gamma > MAX_GAMMA) {\n  params = {...params, gamma: MAX_GAMMA};\n}","typeGuard":"const isGammaInBounds = (g: number | undefined): boolean =>\n  g === undefined || (g >= 0.01 && g <= 10);","tryCatchPattern":null,"preventionTips":["Cap gamma inputs at 10 in sliders and computed values.","Use `extrapolateRight: 'clamp'` on gamma animations.","Validate the full 0.01–10 range before calling levels()."],"tags":["levels","validation","gamma","effect-params"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}