mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-02-25 10:28:39 +00:00
Add reference to the greyscaling formula
This commit is contained in:
parent
9e53e23261
commit
e5dfb1890e
@ -45,6 +45,11 @@ class Burkes:
|
|||||||
>>> Burkes.get_greyscale(255, 255, 255)
|
>>> Burkes.get_greyscale(255, 255, 255)
|
||||||
255.0
|
255.0
|
||||||
"""
|
"""
|
||||||
|
"""
|
||||||
|
Formula from https://en.wikipedia.org/wiki/HSL_and_HSV
|
||||||
|
cf Lightness section, and Fig 13c.
|
||||||
|
We use the first of four possible.
|
||||||
|
"""
|
||||||
return 0.114 * blue + 0.587 * green + 0.299 * red
|
return 0.114 * blue + 0.587 * green + 0.299 * red
|
||||||
|
|
||||||
def process(self) -> None:
|
def process(self) -> None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user