ScratchData LogoScratchData
Back to rdococ's profile

RGB interpolation in perceptual vs linear space

RDrdococ•Created August 26, 2024
RGB interpolation in perceptual vs linear space
8
5
53 views
View on Scratch

Instructions

Top gradient: The two colours interpolated in perceptual space (inaccurate) Bottom gradient: The two colours, converted to linear space, interpolated, then converted back (accurate) Our eyes see light non-linearly: a light dimmed to produce 50% of the photons will look 70% as bright to our eyes. So, our monitors *produce* light output non-linearly: a monitor asked to produce 50% brightness (or an R/G/B value of 128) will only produce 25% so it looks like 50% to our eyes. But our eyes still see *colour mixing* linearly: colours blend much better if you blend them 'raw'. Since monitors expect perceptual brightness values, we have to convert them to linear values, blend them, then convert them back to perceptual values. A colour that's 50% bright should be converted to 70% photons, blended with the other colour, and -then- converted back to brightness, and that's what the bottom gradient does.

Project Details

Project ID1059623342
CreatedAugust 26, 2024
Last ModifiedSeptember 28, 2024
SharedAugust 26, 2024
Visibilityvisible
CommentsAllowed

Remix Information

Parent ProjectView Parent
Root ProjectView Root