Merge pull request #6660 from radarhere/print

This commit is contained in:
Hugo van Kemenade 2022-10-13 11:13:18 +02:00 committed by GitHub
commit 44510d2931
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,10 +6,8 @@ from PIL import Image, ImageMath
def pixel(im): def pixel(im):
if hasattr(im, "im"): if hasattr(im, "im"):
return f"{im.mode} {repr(im.getpixel((0, 0)))}" return f"{im.mode} {repr(im.getpixel((0, 0)))}"
else: elif isinstance(im, int):
if isinstance(im, int): return int(im) # hack to deal with booleans
return int(im) # hack to deal with booleans
print(im)
A = Image.new("L", (1, 1), 1) A = Image.new("L", (1, 1), 1)