Skip to content

Commit 200babd

Browse files
committed
Update bmp2led.py
1 parent b4ed28d commit 200babd

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

CLUE_Light_Painter/bmp2led.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,8 @@ def process(self, input_filename, output_filename, rows,
339339
# Accumulated error vals will all now be 0.0 to <2.0.
340340
# Quantizing err into a new uint8 ndarray, all values
341341
# will be 0 or 1.
342+
# Convert float values in err to integers
343+
err = [int(min(max(0, e), 255)) for e in err]
342344
err_bits = ulab.numpy.array(err, dtype=ulab.numpy.uint8)
343345
# Add the 1's back into 'got', increasing the
344346
# brightness of certain pixels by 1. Because the max

0 commit comments

Comments
 (0)