Skip to content

Commit e5dfb18

Browse files
author
Colin Leroy-Mira
committed
Add reference to the greyscaling formula
1 parent 9e53e23 commit e5dfb18

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

digital_image_processing/dithering/burkes.py

+5
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ def get_greyscale(cls, blue: int, green: int, red: int) -> float:
4545
>>> Burkes.get_greyscale(255, 255, 255)
4646
255.0
4747
"""
48+
"""
49+
Formula from https://en.wikipedia.org/wiki/HSL_and_HSV
50+
cf Lightness section, and Fig 13c.
51+
We use the first of four possible.
52+
"""
4853
return 0.114 * blue + 0.587 * green + 0.299 * red
4954

5055
def process(self) -> None:

0 commit comments

Comments
 (0)