Skip to content

Commit 5ffdfdc

Browse files
authored
Fix silent uint8 overflow (#173)
1 parent 779174d commit 5ffdfdc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/measure/prep_display_image.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ def display(
165165
img = np.roll(img, shift=int(hshift * ny / 100), axis=1)
166166

167167
if brightness:
168-
img = (img * brightness / 100).astype(np.uint8)
168+
img = (img.astype(np.float32) * brightness / 100).astype(np.uint8)
169169

170170
# save to file
171171
im = Image.fromarray(img)

0 commit comments

Comments
 (0)