mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-07-02 02:43:06 +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:
|
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)))}"
|
||||||
|
|
||||||
|
|
||||||
A = Image.new("L", (1, 1), 1)
|
A = Image.new("L", (1, 1), 1)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user