mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-12 10:16:17 +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,8 +8,8 @@ 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)))}"
|
||||
|
||||
return f"{im.mode} {repr(im.getpixel((0, 0)))}"
|
||||
|
||||
|
||||
A = Image.new("L", (1, 1), 1)
|
||||
|
|
Loading…
Reference in New Issue
Block a user