{"record":{"id":"d5d4be606f9473ba","repo":"remotion-dev/remotion","slug":"output-must-be-linear-or-perceptual-scale-but","errorCode":null,"errorMessage":"output must be \"linear\" or \"perceptual-scale\", but got ${String(output)}","messagePattern":"output must be \"linear\" or \"perceptual-scale\", but got (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/src/interpolate.ts","lineNumber":1093,"sourceCode":"\t) {\n\t\tthrow new Error(\n\t\t\t`posterize must be a positive finite number, but got ${posterize}`,\n\t\t);\n\t}\n}\n\nfunction assertValidInterpolateOutputOption(\n\toutput: InterpolateOptions['output'],\n) {\n\tif (\n\t\toutput === undefined ||\n\t\toutput === 'linear' ||\n\t\toutput === 'perceptual-scale'\n\t) {\n\t\treturn;\n\t}\n\n\tthrow new Error(\n\t\t`output must be \"linear\" or \"perceptual-scale\", but got ${String(output)}`,\n\t);\n}\n\n/*\n * @description Allows you to map a range of values to another using a concise syntax.\n * @see [Documentation](https://remotion.dev/docs/interpolate)\n */\n/* eslint-disable no-redeclare */\nexport function interpolate(\n\tinput: number,\n\tinputRange: readonly number[],\n\toutputRange: readonly number[],\n\toptions?: InterpolateOptions,\n): number;\nexport function interpolate(\n\tinput: number,\n\tinputRange: readonly number[],","sourceCodeStart":1075,"sourceCodeEnd":1111,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/core/src/interpolate.ts#L1075-L1111","documentation":"Thrown by assertValidInterpolateOutputOption. The output option selects how numeric interpolation is computed and accepts only the literal values 'linear', 'perceptual-scale', or undefined (defaults to linear). Any other string — including typos — is rejected.","triggerScenarios":"interpolate(t,[0,1],[0,100],{output:'perceptual'}); {output:'Linear'}; {output:'srgb'}; any value not exactly 'linear' or 'perceptual-scale'.","commonSituations":"Typo in the option name; copy from an outdated doc/API that used different names; assuming the option accepts color-space strings like 'srgb'.","solutions":["Use exactly 'linear' or 'perceptual-scale' (lowercase, hyphenated).","Omit the output option to keep the default linear behavior.","Check for stale references to the option name in your code and docs."],"exampleFix":"// before\nconst r = interpolate(t, [0, 1], [0, 100], {output: 'perceptual'});\n// after\nconst r = interpolate(t, [0, 1], [0, 100], {output: 'perceptual-scale'});","handlingStrategy":"validation","validationCode":"const validOutput = ['linear', 'perceptual-scale', undefined] as const;\nif (output !== undefined && !validOutput.includes(output as never)) {\n  throw new Error('output must be \"linear\" or \"perceptual-scale\"');\n}\nconst r = interpolate(input, inputRange, outputRange, {output});","typeGuard":"const isInterpolateOutput = (\n  v: unknown,\n): v is 'linear' | 'perceptual-scale' | undefined =>\n  v === undefined || v === 'linear' || v === 'perceptual-scale';","tryCatchPattern":null,"preventionTips":["Type the option as the literal union 'linear' | 'perceptual-scale'.","Omit output to accept the default linear behavior.","Watch for stale docs or typos when copying the option name."],"tags":["interpolation","validation","options"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}