diff --git a/Adafruit_Thermal.py b/Adafruit_Thermal.py index 2043d5a..a17ebdd 100644 --- a/Adafruit_Thermal.py +++ b/Adafruit_Thermal.py @@ -549,7 +549,11 @@ def printBitmap(self, w, h, bitmap, LaaT=False): # passing the result to this function. def printImage(self, image_file, LaaT=False): from PIL import Image - image = Image.open(image_file) + image = image_file + + if isinstance(image_file, str): + image = Image.open(image_file) + if image.mode != '1': image = image.convert('1')