Skip to content

CLUE Light Painter :: bmp2led.py #2842

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CLUE_Light_Painter/bmp2led.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,8 @@ def process(self, input_filename, output_filename, rows,
# Accumulated error vals will all now be 0.0 to <2.0.
# Quantizing err into a new uint8 ndarray, all values
# will be 0 or 1.
# Convert float values in err to integers
err = [int(min(max(0, e), 255)) for e in err]
err_bits = ulab.numpy.array(err, dtype=ulab.numpy.uint8)
# Add the 1's back into 'got', increasing the
# brightness of certain pixels by 1. Because the max
Expand Down