mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 09:26:16 +03:00
Add type hints
Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
This commit is contained in:
parent
008b28eb0c
commit
7c5d0b9284
|
@ -524,7 +524,7 @@ class Image:
|
||||||
def mode(self):
|
def mode(self):
|
||||||
return self._mode
|
return self._mode
|
||||||
|
|
||||||
def _new(self, im: Image):
|
def _new(self, im) -> Image:
|
||||||
new = Image()
|
new = Image()
|
||||||
new.im = im
|
new.im = im
|
||||||
new._mode = im.mode
|
new._mode = im.mode
|
||||||
|
@ -1347,9 +1347,7 @@ class Image:
|
||||||
self.load()
|
self.load()
|
||||||
return self.im.getbbox(alpha_only)
|
return self.im.getbbox(alpha_only)
|
||||||
|
|
||||||
def getcolors(
|
def getcolors(self, maxcolors: int = 256):
|
||||||
self, maxcolors: int = 256
|
|
||||||
) -> list[tuple[int, int | tuple[int, ...]]] | None:
|
|
||||||
"""
|
"""
|
||||||
Returns a list of colors used in this image.
|
Returns a list of colors used in this image.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user