forked from etemesi254/zune-image
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathzil.pyi
More file actions
67 lines (63 loc) · 1.72 KB
/
Copy pathzil.pyi
File metadata and controls
67 lines (63 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import enum
from typing import Literal, overload
import numpy as np
from numpy.typing import NDArray
class ImageFormat(enum.Enum):
FarbFeld = ...
JPEG = ...
PNG = ...
PSD = ...
Unknown = ...
BMP = ...
HDR = ...
JPEG_XL = ...
PPM = ...
Qoi = ...
class ResizeMethod(enum.Enum):
Bilinear = ...
Bicubic = ...
class Image:
@staticmethod
def open(file: str) -> Image: ...
def save(self, file: str, *, format: ImageFormat) -> None: ...
def dimensions(self) -> tuple[int, int]: ...
def width(self) -> int: ...
def height(self) -> int: ...
@overload
def auto_orient(self, *, in_place: Literal[False]) -> Image: ...
@overload
def auto_orient(self, *, in_place: Literal[True]) -> None: ...
def auto_orient(self, *, in_place: bool) -> Image | None: ...
@overload
def resize(
self,
new_width: int,
new_height: int,
method: ResizeMethod,
*,
in_place: Literal[False],
) -> Image: ...
@overload
def resize(
self,
new_width: int,
new_height: int,
method: ResizeMethod,
*,
in_place: Literal[True],
) -> None: ...
def resize(
self, new_width: int, new_height: int, method: ResizeMethod, *, in_place: bool
) -> Image | None: ...
@overload
def crop(
self, width: int, height: int, x: int, y: int, *, in_place: Literal[False]
) -> Image: ...
@overload
def crop(
self, width: int, height: int, x: int, y: int, *, in_place: Literal[True]
) -> None: ...
def crop(
self, width: int, height: int, x: int, y: int, *, in_place: bool
) -> Image | None: ...
def to_numpy(self) -> NDArray[np.uint8]: ...