mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-02-25 18:38:39 +00:00
Fix greyscale computation and inverted coords
This commit is contained in:
parent
0ef9306976
commit
af92097a91
@ -41,7 +41,7 @@ class Burkes:
|
||||
>>> Burkes.get_greyscale(3, 4, 5)
|
||||
3.753
|
||||
"""
|
||||
return 0.114 * blue + 0.587 * green + 0.2126 * red
|
||||
return 0.114 * blue + 0.587 * green + 0.299 * red
|
||||
|
||||
def process(self) -> None:
|
||||
for y in range(self.height):
|
||||
@ -49,10 +49,10 @@ class Burkes:
|
||||
greyscale = int(self.get_greyscale(*self.input_img[y][x]))
|
||||
if self.threshold > greyscale + self.error_table[y][x]:
|
||||
self.output_img[y][x] = (0, 0, 0)
|
||||
current_error = greyscale + self.error_table[x][y]
|
||||
current_error = greyscale + self.error_table[y][x]
|
||||
else:
|
||||
self.output_img[y][x] = (255, 255, 255)
|
||||
current_error = greyscale + self.error_table[x][y] - 255
|
||||
current_error = greyscale + self.error_table[y][x] - 255
|
||||
"""
|
||||
Burkes error propagation (`*` is current pixel):
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user