Nine Shades of Greyscale

Nine different formulas for greyscale.

Greyscales

255

200

100

000

000

000

000

000

000

000

000

000

There are different ways to calculate greyscale from a colour. They all work well for different jobs, horses for courses, and very badly for other jobs. Generally, looking at a photo converted to greyscale, it’s nigh-on impossible for the eye to tell the difference, but significant when defining text and manipulating photos.

Key:

STW* | The SEEMS TO WORK formula devised by me and described on Readable Text in Colour – STW*. |

gXYZ | Inverse gamma using the XYZ coefficients of R: 0.212655, G: 0.715158 and B: 0.072187, inverse gamma as described on StackOverflow. |

sYIQ | Inverse gamma using the YIQ coefficients of R: 0.299, G: 0.587, B: 0.114, YIQ coefficients also known as Digital CCIR601. |

sXYZ | Square root using the XYZ coefficients: sqrt((0.212655*(R^2)) + (0.715158*(G^2)) + 0.072187*(B^2)). |

sYIQ | Square root using the YIQ coefficients: sqrt((0.299*(R^2)) + (0.587*(G^2)) + (0.114*(B^2)). |

XYX | 0.212655*R + 0.715158*G + 0.072187*B, also known as the Luminosity formula, see Puzzling Greys. |

YIQ | 0.299*R + 0.587*G + 0.114*B, as in the Web Accessibility Guidelines from the W3C, see Holes in the W3C Colour Readability Guidelines. |

Lgt | Lightness: ½ × (max(R,G,B) + min(R,G,B)), see Puzzling Greys. |

Avg | Average:(R + G + B) ÷ 3, see Puzzling Greys. |

This page is now to be found at landofinterruptions.co.uk/nineshades