Simplified code

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
This commit is contained in:
Andrew Murray 2024-02-07 21:02:34 +11:00 committed by GitHub
parent cdc498e6f3
commit 463c368211
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -8,7 +8,7 @@ from PIL import Image, ImageMath
def pixel(im: Image.Image | int) -> str | int:
if isinstance(im, int):
return int(im) # hack to deal with booleans
else:
return f"{im.mode} {repr(im.getpixel((0, 0)))}"