We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 32a3bb9 + 4972f62 commit da6335aCopy full SHA for da6335a
tikzplotlib/_image.py
@@ -34,7 +34,9 @@ def draw_image(data, obj):
34
img_array = numpy.flipud(img_array)
35
36
# Convert mpl image to PIL
37
- image = PIL.Image.fromarray(numpy.uint8(img_array * 255))
+ if img_array.dtype != numpy.uint8:
38
+ img_array = numpy.uint8(img_array * 255)
39
+ image = PIL.Image.fromarray(img_array)
40
41
# If the input image is PIL:
42
# image = PIL.Image.fromarray(img_array)
0 commit comments