mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-10 19:56:47 +03:00
Simplified code
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
This commit is contained in:
parent
cdc498e6f3
commit
463c368211
|
@ -8,7 +8,7 @@ from PIL import Image, ImageMath
|
||||||
def pixel(im: Image.Image | int) -> str | int:
|
def pixel(im: Image.Image | int) -> str | int:
|
||||||
if isinstance(im, int):
|
if isinstance(im, int):
|
||||||
return int(im) # hack to deal with booleans
|
return int(im) # hack to deal with booleans
|
||||||
else:
|
|
||||||
return f"{im.mode} {repr(im.getpixel((0, 0)))}"
|
return f"{im.mode} {repr(im.getpixel((0, 0)))}"
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user