Luminance-Weighted Grayscale Converter
D65 sRGB linear-light luminance to encoded achromatic RGB; not an achromatopsia clinical simulation.
Description
Luminance-Weighted Grayscale Converter: return relative luminance, encoded gray srgb.
Encoded sRGB values are nonlinear, so a luminance-based gray conversion first works in linear light. Relative luminance and the final encoded gray value are different outputs.
This tool returns relative luminance, encoded gray srgb. Use the stated units and model convention when interpreting these fields.
When to use this tool
Use this tool when the supplied inputs match the specific operation described above and you need a repeatable result under its stated convention.
- Check the supported input and output contract against an existing calculation or observation.
- Use the complete example to confirm units, selector spelling and result interpretation.
How to use the tool and how it works
- Enter every field in the input table using the stated units and the exact supported selector spelling where applicable.
- Run the tool. Correct input errors before interpreting an output.
- Read the result fields below; use accompanying flags and the stated sign, boundary or model convention when interpreting a number.
Decode each sRGB channel, combine linear channels using weights 0.2126, 0.7152 and 0.0722, then encode that luminance back to equal sRGB gray channels.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| encodedSrgb | Encoded srgb. | List of finite numbers |
| Output field | Interpretation |
|---|---|
| result | Object containing the following named result fields. |
| result.relativeLuminance | Relative luminance; use the stated units and sign convention. |
| result.encodedGraySrgb | Encoded gray srgb list, in the ordering described in the calculation. |
{
"input": {
"encodedSrgb": [
1,
1,
1
]
},
"output": {
"result": {
"relativeLuminance": 1,
"encodedGraySrgb": [
1,
1,
1
]
}
}
} Limitations and assumptions
- Inputs are normalized sRGB triplets. The tool does not perform arbitrary ICC-profile conversion or preserve all perceptual color differences.
- Every declared field is required and unexpected fields are rejected. Numeric inputs must be finite; input errors are distinct from a valid false result or an explicitly qualified output.
- Extremely large inputs and nonfinite or excessively large outputs are rejected. List positions reported by the tool use zero-based indices unless stated otherwise.
Alternative or Complementary methods
Check the underlying observations, units and conventions independently before using the result in a larger workflow. The tools listed below address nearby tasks; compare their inputs and scope before substituting one for this operation.
References
Similar or alternative tools
- eink 16 level grayscale map
Sixteen-level grayscale quantization needs a declared code polarity.
- relative luminance
Compute WCAG relative luminance from RGB values 0-255.