Skip to content

Commit 1320da4

Browse files
don't multiply by 255 is data is already uint8
1 parent ddf7ae3 commit 1320da4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tikzplotlib/_image.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ def draw_image(data, obj):
3434
img_array = numpy.flipud(img_array)
3535

3636
# Convert mpl image to PIL
37+
if img_array.dtype != numpy.uint8:
38+
img_array = numpy.uint8(img_array * 255)
3739
image = PIL.Image.fromarray(numpy.uint8(img_array * 255))
3840

3941
# If the input image is PIL:

0 commit comments

Comments
 (0)