Remove Pillow stubs (#12732)

This commit is contained in:
Sebastian Rittau
2024-10-03 11:33:09 +02:00
committed by GitHub
parent 735942adb0
commit 848cf9103d
98 changed files with 3 additions and 3775 deletions

View File

@@ -73,7 +73,6 @@
"stubs/peewee",
"stubs/pexpect",
"stubs/pika",
"stubs/Pillow",
"stubs/protobuf",
"stubs/psutil",
"stubs/psycopg2",

View File

@@ -1,30 +0,0 @@
PIL.__main__
# Requires Pyside or PyQt to be installed.
# Not worth adding to tool.stubtest.stubtest_requirements
# because it's only used as a base type and it's a long install.
PIL.ImageQt.ImageQt
# Only stubbing what's necessary from private modules
PIL\._imaging\.\w+?
# Internal logger variable
PIL\..+?\.logger
# Loop variables leaked in global scope
PIL.BmpImagePlugin.BmpImageFile.k
PIL.BmpImagePlugin.BmpImageFile.v
PIL.DdsImagePlugin.item
PIL.Image.enum
PIL.Image.item
PIL.ImageCms.flag
PIL.ImageMath.k
PIL.ImageMath.v
PIL.ImageQt.qt_module
PIL.ImImagePlugin.i
PIL.XVThumbImagePlugin.b
PIL.XVThumbImagePlugin.g
PIL.XVThumbImagePlugin.r
# Forwarded arguments
PIL\.TiffImagePlugin\.IFDRational\.__[a-z]+__

View File

@@ -1,20 +0,0 @@
# Verify that ImageTK images are valid to pass to TK code.
from __future__ import annotations
# The following tests don't work on pyright at the moment, due to it getting
# confused by the existence of these stubs and annotations in the actual
# Pillow package.
# https://github.com/python/typeshed/issues/11688
# pyright: reportArgumentType=false
import tkinter
from PIL import ImageTk
photo = ImageTk.PhotoImage()
bitmap = ImageTk.BitmapImage()
tkinter.Label(image=photo)
tkinter.Label(image=bitmap)
tkinter.Label().configure(image=photo)
tkinter.Label().configure(image=bitmap)

View File

@@ -1,8 +0,0 @@
version = "10.2.*"
upstream_repository = "https://github.com/python-pillow/Pillow"
obsolete_since = "10.3.0" # Released on 2024-04-01
[tool.stubtest]
stubtest_requirements = ["olefile"]
# darwin checks don't affect stubtest
platforms = ["linux", "win32"]

View File

@@ -1,11 +0,0 @@
from _typeshed import Incomplete
from .FontFile import FontFile
bdf_slant: Incomplete
bdf_spacing: Incomplete
def bdf_char(f): ...
class BdfFontFile(FontFile):
def __init__(self, fp) -> None: ...

View File

@@ -1,39 +0,0 @@
from _typeshed import Incomplete
from enum import IntEnum
from typing import ClassVar, Literal
from .ImageFile import ImageFile, PyDecoder, PyEncoder
class Format(IntEnum):
JPEG = 0
class Encoding(IntEnum):
UNCOMPRESSED = 1
DXT = 2
UNCOMPRESSED_RAW_BGRA = 3
class AlphaEncoding(IntEnum):
DXT1 = 0
DXT3 = 1
DXT5 = 7
def unpack_565(i): ...
def decode_dxt1(data, alpha: bool = False): ...
def decode_dxt3(data): ...
def decode_dxt5(data): ...
class BLPFormatError(NotImplementedError): ...
class BlpImageFile(ImageFile):
format: ClassVar[Literal["BLP"]]
format_description: ClassVar[str]
class _BLPBaseDecoder(PyDecoder):
magic: Incomplete
def decode(self, buffer): ...
class BLP1Decoder(_BLPBaseDecoder): ...
class BLP2Decoder(_BLPBaseDecoder): ...
class BLPEncoder(PyEncoder):
def encode(self, bufsize): ...

View File

@@ -1,25 +0,0 @@
from _typeshed import Incomplete
from typing import ClassVar, Final, Literal
from .ImageFile import ImageFile, PyDecoder
BIT2MODE: Incomplete
class BmpImageFile(ImageFile):
RAW: Final = 0
RLE8: Final = 1
RLE4: Final = 2
BITFIELDS: Final = 3
JPEG: Final = 4
PNG: Final = 5
format_description: ClassVar[str]
format: ClassVar[Literal["BMP", "DIB", "CUR"]]
COMPRESSIONS: Incomplete
class BmpRleDecoder(PyDecoder):
def decode(self, buffer): ...
class DibImageFile(BmpImageFile):
format: ClassVar[Literal["DIB"]]
SAVE: Incomplete

View File

@@ -1,9 +0,0 @@
from typing import ClassVar, Literal
from .ImageFile import StubImageFile
def register_handler(handler) -> None: ...
class BufrStubImageFile(StubImageFile):
format: ClassVar[Literal["BUFR"]]
format_description: ClassVar[str]

View File

@@ -1,14 +0,0 @@
from typing import IO, AnyStr, Generic, Literal
class ContainerIO(Generic[AnyStr]):
fh: IO[AnyStr]
pos: int
offset: int
length: int
def __init__(self, file: IO[AnyStr], offset: int, length: int) -> None: ...
def isatty(self) -> bool: ...
def seek(self, offset: int, mode: Literal[0, 1, 2] = 0) -> None: ...
def tell(self) -> int: ...
def read(self, n: int = 0) -> AnyStr: ...
def readline(self) -> AnyStr: ...
def readlines(self) -> list[AnyStr]: ...

View File

@@ -1,6 +0,0 @@
from typing import ClassVar, Literal
from .BmpImagePlugin import BmpImageFile
class CurImageFile(BmpImageFile):
format: ClassVar[Literal["CUR"]]

View File

@@ -1,13 +0,0 @@
from _typeshed import Incomplete
from typing import ClassVar, Literal
from .PcxImagePlugin import PcxImageFile
MAGIC: int
class DcxImageFile(PcxImageFile):
format: ClassVar[Literal["DCX"]]
frame: Incomplete
fp: Incomplete
def seek(self, frame) -> None: ...
def tell(self): ...

View File

@@ -1,314 +0,0 @@
from enum import IntEnum, IntFlag
from typing import ClassVar, Final, Literal
from .ImageFile import ImageFile, PyDecoder
DDS_MAGIC: Final = 0x20534444
class DDSD(IntFlag):
CAPS = 0x1
HEIGHT = 0x2
WIDTH = 0x4
PITCH = 0x8
PIXELFORMAT = 0x1000
MIPMAPCOUNT = 0x20000
LINEARSIZE = 0x80000
DEPTH = 0x800000
class DDSCAPS(IntFlag):
COMPLEX = 0x8
TEXTURE = 0x1000
MIPMAP = 0x400000
class DDSCAPS2(IntFlag):
CUBEMAP = 0x200
CUBEMAP_POSITIVEX = 0x400
CUBEMAP_NEGATIVEX = 0x800
CUBEMAP_POSITIVEY = 0x1000
CUBEMAP_NEGATIVEY = 0x2000
CUBEMAP_POSITIVEZ = 0x4000
CUBEMAP_NEGATIVEZ = 0x8000
VOLUME = 0x200000
class DDPF(IntFlag):
ALPHAPIXELS = 0x1
ALPHA = 0x2
FOURCC = 0x4
PALETTEINDEXED8 = 0x20
RGB = 0x40
LUMINANCE = 0x20000
class DXGI_FORMAT(IntEnum):
UNKNOWN = 0
R32G32B32A32_TYPELESS = 1
R32G32B32A32_FLOAT = 2
R32G32B32A32_UINT = 3
R32G32B32A32_SINT = 4
R32G32B32_TYPELESS = 5
R32G32B32_FLOAT = 6
R32G32B32_UINT = 7
R32G32B32_SINT = 8
R16G16B16A16_TYPELESS = 9
R16G16B16A16_FLOAT = 10
R16G16B16A16_UNORM = 11
R16G16B16A16_UINT = 12
R16G16B16A16_SNORM = 13
R16G16B16A16_SINT = 14
R32G32_TYPELESS = 15
R32G32_FLOAT = 16
R32G32_UINT = 17
R32G32_SINT = 18
R32G8X24_TYPELESS = 19
D32_FLOAT_S8X24_UINT = 20
R32_FLOAT_X8X24_TYPELESS = 21
X32_TYPELESS_G8X24_UINT = 22
R10G10B10A2_TYPELESS = 23
R10G10B10A2_UNORM = 24
R10G10B10A2_UINT = 25
R11G11B10_FLOAT = 26
R8G8B8A8_TYPELESS = 27
R8G8B8A8_UNORM = 28
R8G8B8A8_UNORM_SRGB = 29
R8G8B8A8_UINT = 30
R8G8B8A8_SNORM = 31
R8G8B8A8_SINT = 32
R16G16_TYPELESS = 33
R16G16_FLOAT = 34
R16G16_UNORM = 35
R16G16_UINT = 36
R16G16_SNORM = 37
R16G16_SINT = 38
R32_TYPELESS = 39
D32_FLOAT = 40
R32_FLOAT = 41
R32_UINT = 42
R32_SINT = 43
R24G8_TYPELESS = 44
D24_UNORM_S8_UINT = 45
R24_UNORM_X8_TYPELESS = 46
X24_TYPELESS_G8_UINT = 47
R8G8_TYPELESS = 48
R8G8_UNORM = 49
R8G8_UINT = 50
R8G8_SNORM = 51
R8G8_SINT = 52
R16_TYPELESS = 53
R16_FLOAT = 54
D16_UNORM = 55
R16_UNORM = 56
R16_UINT = 57
R16_SNORM = 58
R16_SINT = 59
R8_TYPELESS = 60
R8_UNORM = 61
R8_UINT = 62
R8_SNORM = 63
R8_SINT = 64
A8_UNORM = 65
R1_UNORM = 66
R9G9B9E5_SHAREDEXP = 67
R8G8_B8G8_UNORM = 68
G8R8_G8B8_UNORM = 69
BC1_TYPELESS = 70
BC1_UNORM = 71
BC1_UNORM_SRGB = 72
BC2_TYPELESS = 73
BC2_UNORM = 74
BC2_UNORM_SRGB = 75
BC3_TYPELESS = 76
BC3_UNORM = 77
BC3_UNORM_SRGB = 78
BC4_TYPELESS = 79
BC4_UNORM = 80
BC4_SNORM = 81
BC5_TYPELESS = 82
BC5_UNORM = 83
BC5_SNORM = 84
B5G6R5_UNORM = 85
B5G5R5A1_UNORM = 86
B8G8R8A8_UNORM = 87
B8G8R8X8_UNORM = 88
R10G10B10_XR_BIAS_A2_UNORM = 89
B8G8R8A8_TYPELESS = 90
B8G8R8A8_UNORM_SRGB = 91
B8G8R8X8_TYPELESS = 92
B8G8R8X8_UNORM_SRGB = 93
BC6H_TYPELESS = 94
BC6H_UF16 = 95
BC6H_SF16 = 96
BC7_TYPELESS = 97
BC7_UNORM = 98
BC7_UNORM_SRGB = 99
AYUV = 100
Y410 = 101
Y416 = 102
NV12 = 103
P010 = 104
P016 = 105
OPAQUE_420 = 106
YUY2 = 107
Y210 = 108
Y216 = 109
NV11 = 110
AI44 = 111
IA44 = 112
P8 = 113
A8P8 = 114
B4G4R4A4_UNORM = 115
P208 = 130
V208 = 131
V408 = 132
SAMPLER_FEEDBACK_MIN_MIP_OPAQUE = 189
SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE = 190
class D3DFMT(IntEnum):
UNKNOWN = 0
R8G8B8 = 20
A8R8G8B8 = 21
X8R8G8B8 = 22
R5G6B5 = 23
X1R5G5B5 = 24
A1R5G5B5 = 25
A4R4G4B4 = 26
R3G3B2 = 27
A8 = 28
A8R3G3B2 = 29
X4R4G4B4 = 30
A2B10G10R10 = 31
A8B8G8R8 = 32
X8B8G8R8 = 33
G16R16 = 34
A2R10G10B10 = 35
A16B16G16R16 = 36
A8P8 = 40
P8 = 41
L8 = 50
A8L8 = 51
A4L4 = 52
V8U8 = 60
L6V5U5 = 61
X8L8V8U8 = 62
Q8W8V8U8 = 63
V16U16 = 64
A2W10V10U10 = 67
D16_LOCKABLE = 70
D32 = 71
D15S1 = 73
D24S8 = 75
D24X8 = 77
D24X4S4 = 79
D16 = 80
D32F_LOCKABLE = 82
D24FS8 = 83
D32_LOCKABLE = 84
S8_LOCKABLE = 85
L16 = 81
VERTEXDATA = 100
INDEX16 = 101
INDEX32 = 102
Q16W16V16U16 = 110
R16F = 111
G16R16F = 112
A16B16G16R16F = 113
R32F = 114
G32R32F = 115
A32B32G32R32F = 116
CxV8U8 = 117
A1 = 118
A2B10G10R10_XR_BIAS = 119
BINARYBUFFER = 199
UYVY = 1498831189 # i32(b"UYVY")
R8G8_B8G8 = 1195525970 # i32(b"RGBG")
YUY2 = 844715353 # i32(b"YUY2")
G8R8_G8B8 = 1111970375 # i32(b"GRGB")
DXT1 = 827611204 # i32(b"DXT1")
DXT2 = 844388420 # i32(b"DXT2")
DXT3 = 861165636 # i32(b"DXT3")
DXT4 = 877942852 # i32(b"DXT4")
DXT5 = 894720068 # i32(b"DXT5")
DX10 = 808540228 # i32(b"DX10")
BC4S = 1395934018 # i32(b"BC4S")
BC4U = 1429488450 # i32(b"BC4U")
BC5S = 1395999554 # i32(b"BC5S")
BC5U = 1429553986 # i32(b"BC5U")
ATI1 = 826889281 # i32(b"ATI1")
ATI2 = 843666497 # i32(b"ATI2")
MULTI2_ARGB8 = 827606349 # i32(b"MET1")
DDSD_CAPS: Final = 0x1
DDSD_HEIGHT: Final = 0x2
DDSD_WIDTH: Final = 0x4
DDSD_PITCH: Final = 0x8
DDSD_PIXELFORMAT: Final = 0x1000
DDSD_MIPMAPCOUNT: Final = 0x20000
DDSD_LINEARSIZE: Final = 0x80000
DDSD_DEPTH: Final = 0x800000
DDSCAPS_COMPLEX: Final = 0x8
DDSCAPS_TEXTURE: Final = 0x1000
DDSCAPS_MIPMAP: Final = 0x400000
DDSCAPS2_CUBEMAP: Final = 0x200
DDSCAPS2_CUBEMAP_POSITIVEX: Final = 0x400
DDSCAPS2_CUBEMAP_NEGATIVEX: Final = 0x800
DDSCAPS2_CUBEMAP_POSITIVEY: Final = 0x1000
DDSCAPS2_CUBEMAP_NEGATIVEY: Final = 0x2000
DDSCAPS2_CUBEMAP_POSITIVEZ: Final = 0x4000
DDSCAPS2_CUBEMAP_NEGATIVEZ: Final = 0x8000
DDSCAPS2_VOLUME: Final = 0x200000
DDPF_ALPHAPIXELS: Final = 0x1
DDPF_ALPHA: Final = 0x2
DDPF_FOURCC: Final = 0x4
DDPF_PALETTEINDEXED8: Final = 0x20
DDPF_RGB: Final = 0x40
DDPF_LUMINANCE: Final = 0x20000
DDS_FOURCC: Final = 0x4
DDS_RGB: Final = 0x40
DDS_RGBA: Final = 0x41
DDS_LUMINANCE: Final = 0x20000
DDS_LUMINANCEA: Final = 0x20001
DDS_ALPHA: Final = 0x2
DDS_PAL8: Final = 0x20
DDS_HEADER_FLAGS_TEXTURE: int
DDS_HEADER_FLAGS_MIPMAP: int
DDS_HEADER_FLAGS_VOLUME: int
DDS_HEADER_FLAGS_PITCH: int
DDS_HEADER_FLAGS_LINEARSIZE: int
DDS_HEIGHT: int
DDS_WIDTH: int
DDS_SURFACE_FLAGS_TEXTURE: int
DDS_SURFACE_FLAGS_MIPMAP: int
DDS_SURFACE_FLAGS_CUBEMAP: int
DDS_CUBEMAP_POSITIVEX: int
DDS_CUBEMAP_NEGATIVEX: int
DDS_CUBEMAP_POSITIVEY: int
DDS_CUBEMAP_NEGATIVEY: int
DDS_CUBEMAP_POSITIVEZ: int
DDS_CUBEMAP_NEGATIVEZ: int
DXT1_FOURCC: Final = 0x31545844
DXT3_FOURCC: Final = 0x33545844
DXT5_FOURCC: Final = 0x35545844
DXGI_FORMAT_R8G8B8A8_TYPELESS: Final = 27
DXGI_FORMAT_R8G8B8A8_UNORM: Final = 28
DXGI_FORMAT_R8G8B8A8_UNORM_SRGB: Final = 29
DXGI_FORMAT_BC5_TYPELESS: Final = 82
DXGI_FORMAT_BC5_UNORM: Final = 83
DXGI_FORMAT_BC5_SNORM: Final = 84
DXGI_FORMAT_BC6H_UF16: Final = 95
DXGI_FORMAT_BC6H_SF16: Final = 96
DXGI_FORMAT_BC7_TYPELESS: Final = 97
DXGI_FORMAT_BC7_UNORM: Final = 98
DXGI_FORMAT_BC7_UNORM_SRGB: Final = 99
class DdsImageFile(ImageFile):
format: ClassVar[Literal["DDS"]]
format_description: ClassVar[str]
def load_seek(self, pos: int) -> None: ...
class DdsRgbDecoder(PyDecoder): ...

View File

@@ -1,34 +0,0 @@
import sys
from _typeshed import Incomplete
from typing import ClassVar, Literal
from ._imaging import _PixelAccessor
from .ImageFile import ImageFile
split: Incomplete
field: Incomplete
if sys.platform == "win32":
gs_binary: Literal["gswin32c", "gswin64c", "gs", False] | None
gs_windows_binary: Literal["gswin32c", "gswin64c", "gs", False] | None
else:
gs_binary: Literal["gs", False] | None
gs_windows_binary: None
def has_ghostscript(): ...
def Ghostscript(tile, size, fp, scale: int = 1, transparency: bool = False): ...
class PSFile:
fp: Incomplete
char: Incomplete
def __init__(self, fp) -> None: ...
def seek(self, offset, whence=0) -> None: ...
def readline(self): ...
class EpsImageFile(ImageFile):
format: ClassVar[Literal["EPS"]]
format_description: ClassVar[str]
mode_map: Incomplete
im: Incomplete
tile: Incomplete
def load(self, scale: int = 1, transparency: bool = False) -> _PixelAccessor: ...
def load_seek(self, *args, **kwargs) -> None: ...

View File

@@ -1,347 +0,0 @@
from collections.abc import Mapping
from enum import IntEnum
class Base(IntEnum):
InteropIndex = 0x0001
ProcessingSoftware = 0x000B
NewSubfileType = 0x00FE
SubfileType = 0x00FF
ImageWidth = 0x0100
ImageLength = 0x0101
BitsPerSample = 0x0102
Compression = 0x0103
PhotometricInterpretation = 0x0106
Thresholding = 0x0107
CellWidth = 0x0108
CellLength = 0x0109
FillOrder = 0x010A
DocumentName = 0x010D
ImageDescription = 0x010E
Make = 0x010F
Model = 0x0110
StripOffsets = 0x0111
Orientation = 0x0112
SamplesPerPixel = 0x0115
RowsPerStrip = 0x0116
StripByteCounts = 0x0117
MinSampleValue = 0x0118
MaxSampleValue = 0x0119
XResolution = 0x011A
YResolution = 0x011B
PlanarConfiguration = 0x011C
PageName = 0x011D
FreeOffsets = 0x0120
FreeByteCounts = 0x0121
GrayResponseUnit = 0x0122
GrayResponseCurve = 0x0123
T4Options = 0x0124
T6Options = 0x0125
ResolutionUnit = 0x0128
PageNumber = 0x0129
TransferFunction = 0x012D
Software = 0x0131
DateTime = 0x0132
Artist = 0x013B
HostComputer = 0x013C
Predictor = 0x013D
WhitePoint = 0x013E
PrimaryChromaticities = 0x013F
ColorMap = 0x0140
HalftoneHints = 0x0141
TileWidth = 0x0142
TileLength = 0x0143
TileOffsets = 0x0144
TileByteCounts = 0x0145
SubIFDs = 0x014A
InkSet = 0x014C
InkNames = 0x014D
NumberOfInks = 0x014E
DotRange = 0x0150
TargetPrinter = 0x0151
ExtraSamples = 0x0152
SampleFormat = 0x0153
SMinSampleValue = 0x0154
SMaxSampleValue = 0x0155
TransferRange = 0x0156
ClipPath = 0x0157
XClipPathUnits = 0x0158
YClipPathUnits = 0x0159
Indexed = 0x015A
JPEGTables = 0x015B
OPIProxy = 0x015F
JPEGProc = 0x0200
JpegIFOffset = 0x0201
JpegIFByteCount = 0x0202
JpegRestartInterval = 0x0203
JpegLosslessPredictors = 0x0205
JpegPointTransforms = 0x0206
JpegQTables = 0x0207
JpegDCTables = 0x0208
JpegACTables = 0x0209
YCbCrCoefficients = 0x0211
YCbCrSubSampling = 0x0212
YCbCrPositioning = 0x0213
ReferenceBlackWhite = 0x0214
XMLPacket = 0x02BC
RelatedImageFileFormat = 0x1000
RelatedImageWidth = 0x1001
RelatedImageLength = 0x1002
Rating = 0x4746
RatingPercent = 0x4749
ImageID = 0x800D
CFARepeatPatternDim = 0x828D
BatteryLevel = 0x828F
Copyright = 0x8298
ExposureTime = 0x829A
FNumber = 0x829D
IPTCNAA = 0x83BB
ImageResources = 0x8649
ExifOffset = 0x8769
InterColorProfile = 0x8773
ExposureProgram = 0x8822
SpectralSensitivity = 0x8824
GPSInfo = 0x8825
ISOSpeedRatings = 0x8827
OECF = 0x8828
Interlace = 0x8829
TimeZoneOffset = 0x882A
SelfTimerMode = 0x882B
SensitivityType = 0x8830
StandardOutputSensitivity = 0x8831
RecommendedExposureIndex = 0x8832
ISOSpeed = 0x8833
ISOSpeedLatitudeyyy = 0x8834
ISOSpeedLatitudezzz = 0x8835
ExifVersion = 0x9000
DateTimeOriginal = 0x9003
DateTimeDigitized = 0x9004
OffsetTime = 0x9010
OffsetTimeOriginal = 0x9011
OffsetTimeDigitized = 0x9012
ComponentsConfiguration = 0x9101
CompressedBitsPerPixel = 0x9102
ShutterSpeedValue = 0x9201
ApertureValue = 0x9202
BrightnessValue = 0x9203
ExposureBiasValue = 0x9204
MaxApertureValue = 0x9205
SubjectDistance = 0x9206
MeteringMode = 0x9207
LightSource = 0x9208
Flash = 0x9209
FocalLength = 0x920A
Noise = 0x920D
ImageNumber = 0x9211
SecurityClassification = 0x9212
ImageHistory = 0x9213
TIFFEPStandardID = 0x9216
MakerNote = 0x927C
UserComment = 0x9286
SubsecTime = 0x9290
SubsecTimeOriginal = 0x9291
SubsecTimeDigitized = 0x9292
AmbientTemperature = 0x9400
Humidity = 0x9401
Pressure = 0x9402
WaterDepth = 0x9403
Acceleration = 0x9404
CameraElevationAngle = 0x9405
XPTitle = 0x9C9B
XPComment = 0x9C9C
XPAuthor = 0x9C9D
XPKeywords = 0x9C9E
XPSubject = 0x9C9F
FlashPixVersion = 0xA000
ColorSpace = 0xA001
ExifImageWidth = 0xA002
ExifImageHeight = 0xA003
RelatedSoundFile = 0xA004
ExifInteroperabilityOffset = 0xA005
FlashEnergy = 0xA20B
SpatialFrequencyResponse = 0xA20C
FocalPlaneXResolution = 0xA20E
FocalPlaneYResolution = 0xA20F
FocalPlaneResolutionUnit = 0xA210
SubjectLocation = 0xA214
ExposureIndex = 0xA215
SensingMethod = 0xA217
FileSource = 0xA300
SceneType = 0xA301
CFAPattern = 0xA302
CustomRendered = 0xA401
ExposureMode = 0xA402
WhiteBalance = 0xA403
DigitalZoomRatio = 0xA404
FocalLengthIn35mmFilm = 0xA405
SceneCaptureType = 0xA406
GainControl = 0xA407
Contrast = 0xA408
Saturation = 0xA409
Sharpness = 0xA40A
DeviceSettingDescription = 0xA40B
SubjectDistanceRange = 0xA40C
ImageUniqueID = 0xA420
CameraOwnerName = 0xA430
BodySerialNumber = 0xA431
LensSpecification = 0xA432
LensMake = 0xA433
LensModel = 0xA434
LensSerialNumber = 0xA435
CompositeImage = 0xA460
CompositeImageCount = 0xA461
CompositeImageExposureTimes = 0xA462
Gamma = 0xA500
PrintImageMatching = 0xC4A5
DNGVersion = 0xC612
DNGBackwardVersion = 0xC613
UniqueCameraModel = 0xC614
LocalizedCameraModel = 0xC615
CFAPlaneColor = 0xC616
CFALayout = 0xC617
LinearizationTable = 0xC618
BlackLevelRepeatDim = 0xC619
BlackLevel = 0xC61A
BlackLevelDeltaH = 0xC61B
BlackLevelDeltaV = 0xC61C
WhiteLevel = 0xC61D
DefaultScale = 0xC61E
DefaultCropOrigin = 0xC61F
DefaultCropSize = 0xC620
ColorMatrix1 = 0xC621
ColorMatrix2 = 0xC622
CameraCalibration1 = 0xC623
CameraCalibration2 = 0xC624
ReductionMatrix1 = 0xC625
ReductionMatrix2 = 0xC626
AnalogBalance = 0xC627
AsShotNeutral = 0xC628
AsShotWhiteXY = 0xC629
BaselineExposure = 0xC62A
BaselineNoise = 0xC62B
BaselineSharpness = 0xC62C
BayerGreenSplit = 0xC62D
LinearResponseLimit = 0xC62E
CameraSerialNumber = 0xC62F
LensInfo = 0xC630
ChromaBlurRadius = 0xC631
AntiAliasStrength = 0xC632
ShadowScale = 0xC633
DNGPrivateData = 0xC634
MakerNoteSafety = 0xC635
CalibrationIlluminant1 = 0xC65A
CalibrationIlluminant2 = 0xC65B
BestQualityScale = 0xC65C
RawDataUniqueID = 0xC65D
OriginalRawFileName = 0xC68B
OriginalRawFileData = 0xC68C
ActiveArea = 0xC68D
MaskedAreas = 0xC68E
AsShotICCProfile = 0xC68F
AsShotPreProfileMatrix = 0xC690
CurrentICCProfile = 0xC691
CurrentPreProfileMatrix = 0xC692
ColorimetricReference = 0xC6BF
CameraCalibrationSignature = 0xC6F3
ProfileCalibrationSignature = 0xC6F4
AsShotProfileName = 0xC6F6
NoiseReductionApplied = 0xC6F7
ProfileName = 0xC6F8
ProfileHueSatMapDims = 0xC6F9
ProfileHueSatMapData1 = 0xC6FA
ProfileHueSatMapData2 = 0xC6FB
ProfileToneCurve = 0xC6FC
ProfileEmbedPolicy = 0xC6FD
ProfileCopyright = 0xC6FE
ForwardMatrix1 = 0xC714
ForwardMatrix2 = 0xC715
PreviewApplicationName = 0xC716
PreviewApplicationVersion = 0xC717
PreviewSettingsName = 0xC718
PreviewSettingsDigest = 0xC719
PreviewColorSpace = 0xC71A
PreviewDateTime = 0xC71B
RawImageDigest = 0xC71C
OriginalRawFileDigest = 0xC71D
SubTileBlockSize = 0xC71E
RowInterleaveFactor = 0xC71F
ProfileLookTableDims = 0xC725
ProfileLookTableData = 0xC726
OpcodeList1 = 0xC740
OpcodeList2 = 0xC741
OpcodeList3 = 0xC74E
NoiseProfile = 0xC761
TAGS: Mapping[int, str]
class GPS(IntEnum):
GPSVersionID = 0
GPSLatitudeRef = 1
GPSLatitude = 2
GPSLongitudeRef = 3
GPSLongitude = 4
GPSAltitudeRef = 5
GPSAltitude = 6
GPSTimeStamp = 7
GPSSatellites = 8
GPSStatus = 9
GPSMeasureMode = 10
GPSDOP = 11
GPSSpeedRef = 12
GPSSpeed = 13
GPSTrackRef = 14
GPSTrack = 15
GPSImgDirectionRef = 16
GPSImgDirection = 17
GPSMapDatum = 18
GPSDestLatitudeRef = 19
GPSDestLatitude = 20
GPSDestLongitudeRef = 21
GPSDestLongitude = 22
GPSDestBearingRef = 23
GPSDestBearing = 24
GPSDestDistanceRef = 25
GPSDestDistance = 26
GPSProcessingMethod = 27
GPSAreaInformation = 28
GPSDateStamp = 29
GPSDifferential = 30
GPSHPositioningError = 31
GPSTAGS: Mapping[int, str]
class Interop(IntEnum):
InteropIndex = 1
InteropVersion = 2
RelatedImageFileFormat = 4096
RelatedImageWidth = 4097
RleatedImageHeight = 4098
class IFD(IntEnum):
Exif = 34665
GPSInfo = 34853
Makernote = 37500
Interop = 40965
IFD1 = -1
class LightSource(IntEnum):
Unknown = 0
Daylight = 1
Fluorescent = 2
Tungsten = 3
Flash = 4
Fine = 9
Cloudy = 10
Shade = 11
DaylightFluorescent = 12
DayWhiteFluorescent = 13
CoolWhiteFluorescent = 14
WhiteFluorescent = 15
StandardLightA = 17
StandardLightB = 18
StandardLightC = 19
D55 = 20
D65 = 21
D75 = 22
D50 = 23
ISO = 24
Other = 255

View File

@@ -1,7 +0,0 @@
from typing import ClassVar
from . import Image as Image, ImageFile as ImageFile
class FitsImageFile(ImageFile.ImageFile):
format: ClassVar[str]
format_description: ClassVar[str]

View File

@@ -1,9 +0,0 @@
from typing import ClassVar, Literal
from .ImageFile import ImageFile
class FliImageFile(ImageFile):
format: ClassVar[Literal["FLI"]]
format_description: ClassVar[str]
def seek(self, frame) -> None: ...
def tell(self): ...

View File

@@ -1,16 +0,0 @@
from _typeshed import Incomplete
WIDTH: int
def puti16(fp, values) -> None: ...
class FontFile:
bitmap: Incomplete
info: Incomplete
glyph: Incomplete
def __init__(self) -> None: ...
def __getitem__(self, ix): ...
ysize: Incomplete
metrics: Incomplete
def compile(self): ...
def save(self, filename) -> None: ...

View File

@@ -1,23 +0,0 @@
from _typeshed import Incomplete
from typing import Any, ClassVar, Literal
from typing_extensions import TypeAlias
from ._imaging import _PixelAccessor
from .ImageFile import ImageFile
_OleFileIO: TypeAlias = Any # olefile.OleFileIO
_OleStream: TypeAlias = Any # olefile.OleStream
MODES: dict[tuple[int, ...], tuple[str, str]]
class FpxImageFile(ImageFile):
ole: _OleFileIO
format: ClassVar[Literal["FPX"]]
format_description: ClassVar[str]
fp: _OleStream | None
maxid: int
rawmode: str
jpeg: dict[int, Incomplete]
tile_prefix: Incomplete
stream: list[str]
def load(self) -> _PixelAccessor: ...

View File

@@ -1,15 +0,0 @@
from enum import IntEnum
from typing import ClassVar, Literal
from .ImageFile import ImageFile
MAGIC: bytes
class Format(IntEnum):
DXT1 = 0
UNCOMPRESSED = 1
class FtexImageFile(ImageFile):
format: ClassVar[Literal["FTEX"]]
format_description: ClassVar[str]
def load_seek(self, pos) -> None: ...

View File

@@ -1,11 +0,0 @@
from _typeshed import Incomplete
from typing import ClassVar, Literal
from ._imaging import _PixelAccessor
from .ImageFile import ImageFile
class GbrImageFile(ImageFile):
format: ClassVar[Literal["GBR"]]
format_description: ClassVar[str]
im: Incomplete
def load(self) -> _PixelAccessor: ...

View File

@@ -1,9 +0,0 @@
from typing import ClassVar, Literal
from .ImageFile import ImageFile
class GdImageFile(ImageFile):
format: ClassVar[Literal["GD"]]
format_description: ClassVar[str]
def open(fp, mode: str = "r"): ...

View File

@@ -1,31 +0,0 @@
from _typeshed import Incomplete
from enum import IntEnum
from typing import ClassVar, Literal
from .ImageFile import ImageFile
class LoadingStrategy(IntEnum):
RGB_AFTER_FIRST = 0
RGB_AFTER_DIFFERENT_PALETTE_ONLY = 1
RGB_ALWAYS = 2
LOADING_STRATEGY: LoadingStrategy
class GifImageFile(ImageFile):
format: ClassVar[Literal["GIF"]]
format_description: ClassVar[str]
global_palette: Incomplete
def data(self): ...
@property
def n_frames(self): ...
@property
def is_animated(self): ...
im: Incomplete
def seek(self, frame) -> None: ...
def tell(self): ...
RAWMODE: Incomplete
def get_interlace(im): ...
def getheader(im, palette: Incomplete | None = None, info: Incomplete | None = None): ...
def getdata(im, offset=(0, 0), **params): ...

View File

@@ -1,19 +0,0 @@
from _typeshed import Incomplete
EPSILON: float
def linear(middle, pos): ...
def curved(middle, pos): ...
def sine(middle, pos): ...
def sphere_increasing(middle, pos): ...
def sphere_decreasing(middle, pos): ...
SEGMENTS: Incomplete
class GradientFile:
gradient: Incomplete
def getpalette(self, entries: int = 256): ...
class GimpGradientFile(GradientFile):
gradient: Incomplete
def __init__(self, fp) -> None: ...

View File

@@ -1,7 +0,0 @@
from _typeshed import Incomplete
class GimpPaletteFile:
rawmode: str
palette: Incomplete
def __init__(self, fp) -> None: ...
def getpalette(self): ...

View File

@@ -1,9 +0,0 @@
from typing import ClassVar, Literal
from .ImageFile import StubImageFile
def register_handler(handler) -> None: ...
class GribStubImageFile(StubImageFile):
format: ClassVar[Literal["GRIB"]]
format_description: ClassVar[str]

View File

@@ -1,9 +0,0 @@
from typing import ClassVar, Literal
from .ImageFile import StubImageFile
def register_handler(handler) -> None: ...
class HDF5StubImageFile(StubImageFile):
format: ClassVar[Literal["HDF5"]]
format_description: ClassVar[str]

View File

@@ -1,36 +0,0 @@
from _typeshed import Incomplete
from typing import ClassVar, Final, Literal
from ._imaging import _PixelAccessor
from .ImageFile import ImageFile
enable_jpeg2k: Incomplete
MAGIC: Final = b"icns"
HEADERSIZE: Final = 8
def nextheader(fobj): ...
def read_32t(fobj, start_length, size): ...
def read_32(fobj, start_length, size): ...
def read_mk(fobj, start_length, size): ...
def read_png_or_jpeg2000(fobj, start_length, size): ...
class IcnsFile:
SIZES: Incomplete
dct: Incomplete
fobj: Incomplete
def __init__(self, fobj) -> None: ...
def itersizes(self): ...
def bestsize(self): ...
def dataforsize(self, size): ...
def getimage(self, size: Incomplete | None = None): ...
class IcnsImageFile(ImageFile):
format: ClassVar[Literal["ICNS"]]
format_description: ClassVar[str]
@property
def size(self): ...
@size.setter
def size(self, value) -> None: ...
best_size: Incomplete
im: Incomplete
def load(self) -> _PixelAccessor: ...

View File

@@ -1,26 +0,0 @@
from _typeshed import Incomplete
from typing import ClassVar, Literal
from ._imaging import _PixelAccessor
from .ImageFile import ImageFile
class IcoFile:
buf: Incomplete
entry: Incomplete
nb_items: Incomplete
def __init__(self, buf): ...
def sizes(self): ...
def getentryindex(self, size, bpp: bool = False): ...
def getimage(self, size, bpp: bool = False): ...
def frame(self, idx): ...
class IcoImageFile(ImageFile):
format: ClassVar[Literal["ICO"]]
format_description: ClassVar[str]
@property
def size(self): ...
@size.setter
def size(self, value) -> None: ...
im: Incomplete
def load(self) -> _PixelAccessor: ...
def load_seek(self) -> None: ...

View File

@@ -1,34 +0,0 @@
from _typeshed import Incomplete
from typing import ClassVar, Literal
from .ImageFile import ImageFile
COMMENT: str
DATE: str
EQUIPMENT: str
FRAMES: str
LUT: str
NAME: str
SCALE: str
SIZE: str
MODE: str
TAGS: Incomplete
OPEN: Incomplete
split: Incomplete
def number(s): ...
class ImImageFile(ImageFile):
format: ClassVar[Literal["IM"]]
format_description: ClassVar[str]
@property
def n_frames(self): ...
@property
def is_animated(self): ...
frame: Incomplete
fp: Incomplete
tile: Incomplete
def seek(self, frame) -> None: ...
def tell(self): ...
SAVE: Incomplete

View File

@@ -1,342 +0,0 @@
from _typeshed import Incomplete, SupportsRead, SupportsWrite, Unused
from collections.abc import Callable, Iterable, Iterator, MutableMapping, Sequence
from enum import IntEnum
from pathlib import Path
from typing import Any, ClassVar, Final, Literal, Protocol, SupportsBytes
from typing_extensions import Self, TypeAlias, TypeGuard
from PIL.PyAccess import PyAccess
from ._imaging import (
DEFAULT_STRATEGY as DEFAULT_STRATEGY,
FILTERED as FILTERED,
FIXED as FIXED,
HUFFMAN_ONLY as HUFFMAN_ONLY,
RLE as RLE,
_PixelAccessor,
)
from .ImageFilter import Filter
from .ImagePalette import ImagePalette
_Mode: TypeAlias = str
_Resample: TypeAlias = Literal[0, 1, 2, 3, 4, 5]
_Size: TypeAlias = tuple[int, int]
_Box: TypeAlias = tuple[int, int, int, int]
_ConversionMatrix: TypeAlias = (
tuple[float, float, float, float] | tuple[float, float, float, float, float, float, float, float, float, float, float, float]
)
# `str` values are only accepted if mode="RGB" for an `Image` object
# `float` values are only accepted for certain modes such as "F"
# See https://pillow.readthedocs.io/en/stable/reference/Image.html#PIL.Image.new
_Color: TypeAlias = (
int | tuple[int] | tuple[int, int] | tuple[int, int, int] | tuple[int, int, int, int] | str | float | tuple[float]
)
class _Writeable(SupportsWrite[bytes], Protocol):
def seek(self, offset: int, /) -> Any: ...
# Ref: https://numpy.org/doc/stable/reference/arrays.interface.html#python-side
class _SupportsArrayInterface(Protocol):
@property
def __array_interface__(self) -> dict[str, Any]: ...
class DecompressionBombWarning(RuntimeWarning): ...
class DecompressionBombError(Exception): ...
# Despite the ALL_CAPS spelling, Pillow's docs mention that this threshold can
# be altered at runtime. See
# https://pillow.readthedocs.io/en/stable/reference/Image.html#PIL.Image.open
# or the permalink
# https://github.com/python-pillow/Pillow/blob/10.0.0/docs/reference/Image.rst?plain=1#L54-L55
MAX_IMAGE_PIXELS: int | None
USE_CFFI_ACCESS: bool
def isImageType(t: object) -> TypeGuard[Image]: ...
class Transpose(IntEnum):
FLIP_LEFT_RIGHT = 0
FLIP_TOP_BOTTOM = 1
ROTATE_90 = 2
ROTATE_180 = 3
ROTATE_270 = 4
TRANSPOSE = 5
TRANSVERSE = 6
# All Transpose items
FLIP_LEFT_RIGHT: Final = 0
FLIP_TOP_BOTTOM: Final = 1
ROTATE_90: Final = 2
ROTATE_180: Final = 3
ROTATE_270: Final = 4
TRANSPOSE: Final = 5
TRANSVERSE: Final = 6
class Transform(IntEnum):
AFFINE = 0
EXTENT = 1
PERSPECTIVE = 2
QUAD = 3
MESH = 4
# All Transform items
AFFINE: Final = 0
EXTENT: Final = 1
PERSPECTIVE: Final = 2
QUAD: Final = 3
MESH: Final = 4
class Resampling(IntEnum):
NEAREST = 0
LANCZOS = 1
BILINEAR = 2
BICUBIC = 3
BOX = 4
HAMMING = 5
# All Resampling items
NEAREST: Final = 0
LANCZOS: Final = 1
BILINEAR: Final = 2
BICUBIC: Final = 3
BOX: Final = 4
HAMMING: Final = 5
class Dither(IntEnum):
NONE = 0
ORDERED = 1
RASTERIZE = 2
FLOYDSTEINBERG = 3
# All Dither items
NONE: Final = 0
ORDERED: Final = 1
RASTERIZE: Final = 2
FLOYDSTEINBERG: Final = 3
class Palette(IntEnum):
WEB = 0
ADAPTIVE = 1
# All Palette items
WEB: Final = 0
ADAPTIVE: Final = 1
class Quantize(IntEnum):
MEDIANCUT = 0
MAXCOVERAGE = 1
FASTOCTREE = 2
LIBIMAGEQUANT = 3
# All Quantize items
MEDIANCUT: Final = 0
MAXCOVERAGE: Final = 1
FASTOCTREE: Final = 2
LIBIMAGEQUANT: Final = 3
ID: list[str]
OPEN: dict[str, Any]
MIME: dict[str, str]
SAVE: dict[str, Any]
SAVE_ALL: dict[str, Any]
EXTENSION: dict[str, str]
DECODERS: dict[str, Any]
ENCODERS: dict[str, Any]
MODES: list[_Mode]
def getmodebase(mode: _Mode) -> Literal["L", "RGB"]: ...
def getmodetype(mode: _Mode) -> Literal["L", "I", "F"]: ...
def getmodebandnames(mode: _Mode) -> tuple[str, ...]: ...
def getmodebands(mode: _Mode) -> int: ...
def preinit() -> None: ...
def init() -> None: ...
class _E:
scale: Incomplete
offset: Incomplete
def __init__(self, scale, offset) -> None: ...
def __neg__(self) -> _E: ...
def __add__(self, other) -> _E: ...
__radd__ = __add__
def __sub__(self, other): ...
def __rsub__(self, other): ...
def __mul__(self, other) -> _E: ...
__rmul__ = __mul__
def __truediv__(self, other) -> _E: ...
_ImageState: TypeAlias = tuple[dict[str, Any], str, tuple[int, int], Any, bytes]
class Image:
format: ClassVar[str | None]
format_description: ClassVar[str | None]
im: Incomplete
palette: Incomplete
info: dict[Incomplete, Incomplete]
readonly: int
pyaccess: PyAccess | None
is_animated: bool # not present on all Image objects
n_frames: int # not present on all Image objects
# Only defined after a call to save().
encoderconfig: tuple[Incomplete, ...]
@property
def width(self) -> int: ...
@property
def height(self) -> int: ...
@property
def size(self) -> tuple[int, int]: ...
@property
def mode(self) -> _Mode: ...
def __enter__(self) -> Self: ...
def __exit__(self, *args: Unused) -> None: ...
def close(self) -> None: ...
def __eq__(self, other: object) -> bool: ...
@property
def __array_interface__(self): ...
def __getstate__(self) -> _ImageState: ...
def __setstate__(self, state: _ImageState) -> None: ...
def tobytes(self, encoder_name: str = "raw", *args) -> bytes: ...
def tobitmap(self, name: str = "image") -> bytes: ...
def frombytes(self, data: bytes, decoder_name: str = "raw", *args) -> None: ...
def load(self) -> _PixelAccessor: ...
def verify(self) -> None: ...
def convert(
self,
mode: _Mode | None = None,
matrix: _ConversionMatrix | None = None,
dither: int | None = None,
palette: Palette | Literal[0, 1] = ...,
colors: int = 256,
) -> Image: ...
def quantize(
self,
colors: int = 256,
method: Quantize | Literal[0, 1, 2, 3] | None = None,
kmeans: int = 0,
palette: Image | None = None,
dither: int = ...,
) -> Image: ...
def copy(self) -> Image: ...
__copy__ = copy
def crop(self, box: _Box | None = None) -> Image: ...
def draft(self, mode: _Mode, size: _Size) -> None: ...
def filter(self, filter: Filter | Callable[[], Filter]) -> Image: ...
def getbands(self) -> tuple[str, ...]: ...
def getbbox(self, *, alpha_only: bool = True) -> tuple[int, int, int, int] | None: ...
def getcolors(self, maxcolors: int = 256) -> list[tuple[int, int]]: ...
def getdata(self, band: int | None = None): ...
def getextrema(self): ...
def getexif(self) -> Exif: ...
def get_child_images(self) -> list[Image]: ...
def getim(self): ...
def getpalette(self, rawmode: str | None = "RGB") -> list[int] | None: ...
@property
def has_transparency_data(self) -> bool: ...
def apply_transparency(self) -> None: ...
def getpixel(self, xy: tuple[int, int]): ...
def getprojection(self) -> tuple[list[int], list[int]]: ...
def histogram(self, mask: Image | None = None, extrema: tuple[int, int] | tuple[float, float] | None = None) -> list[int]: ...
def entropy(self, mask: Image | None = None, extrema: tuple[int, int] | tuple[float, float] | None = None) -> float: ...
def paste(self, im: Image | _Color, box: tuple[int, int] | _Box | None = None, mask: Image | None = None) -> None: ...
def alpha_composite(self, im: Image, dest: tuple[int, int] = (0, 0), source: tuple[int, int] = (0, 0)) -> None: ...
def point(self, lut, mode: _Mode | None = None) -> Image: ...
def putalpha(self, alpha: Image | int) -> None: ...
def putdata(self, data: Sequence[int], scale: float = 1.0, offset: float = 0.0) -> None: ...
def putpalette(self, data: ImagePalette | bytes | Iterable[int] | SupportsBytes, rawmode: _Mode | None = "RGB") -> None: ...
def putpixel(self, xy: tuple[int, int], value: _Color | list[float]) -> None: ...
def remap_palette(self, dest_map: Iterable[int], source_palette: Sequence[int] | None = None) -> Image: ...
def resize(
self,
size: tuple[int, int],
resample: Resampling | _Resample | None = None,
box: tuple[float, float, float, float] | None = None,
reducing_gap: float | None = None,
) -> Image: ...
def reduce(self, factor: int | tuple[int, int] | list[int], box: _Box | None = None) -> Image: ...
def rotate(
self,
angle: float,
resample: Resampling | _Resample = ...,
expand: bool = ...,
center: tuple[float, float] | None = None,
translate: tuple[float, float] | None = None,
fillcolor: _Color | None = None,
) -> Image: ...
def save(
self,
fp: str | bytes | Path | _Writeable,
format: str | None = None,
*,
save_all: bool = ...,
bitmap_format: Literal["bmp", "png"] = ..., # for ICO files
optimize: bool = ...,
**params: Any,
) -> None: ...
def seek(self, frame: int) -> None: ...
def show(self, title: str | None = None) -> None: ...
def split(self) -> tuple[Image, ...]: ...
def getchannel(self, channel: int | str) -> Image: ...
def tell(self) -> int: ...
def thumbnail(self, size: tuple[int, int], resample: Resampling | _Resample = ..., reducing_gap: float = 2.0) -> None: ...
def transform(
self,
size: _Size,
method: Transform | Literal[0, 1, 2, 3, 4],
data=None,
resample: Resampling | _Resample = ...,
fill: int = 1,
fillcolor: _Color | int | None = None,
) -> Image: ...
def transpose(self, method: Transpose | Literal[0, 1, 2, 3, 4, 5, 6]) -> Image: ...
def effect_spread(self, distance: int) -> Image: ...
def toqimage(self): ...
def toqpixmap(self): ...
class ImagePointHandler: ...
class ImageTransformHandler: ...
def new(mode: _Mode, size: tuple[int, int], color: _Color = 0) -> Image: ...
def frombytes(mode: _Mode, size: tuple[int, int], data, decoder_name: str = "raw", *args) -> Image: ...
def frombuffer(mode: _Mode, size: tuple[int, int], data, decoder_name: str = "raw", *args) -> Image: ...
# If the __array_interface__ has "strides", then `obj` must also support `tobytes` or `tostring`, but we can't enforce that
def fromarray(obj: _SupportsArrayInterface, mode: _Mode | None = None) -> Image: ...
def fromqimage(im) -> Image: ...
def fromqpixmap(im) -> Image: ...
def open(
fp: str | bytes | Path | SupportsRead[bytes], mode: Literal["r"] = "r", formats: list[str] | tuple[str, ...] | None = None
) -> Image: ...
def alpha_composite(im1: Image, im2: Image) -> Image: ...
def blend(im1: Image, im2: Image, alpha: float) -> Image: ...
def composite(image1: Image, image2: Image, mask: Image) -> Image: ...
def eval(image: Image, *args) -> Image: ...
def merge(mode: _Mode, bands: Sequence[Image]) -> Image: ...
def register_open(id: str, factory, accept=None) -> None: ...
def register_mime(id: str, mimetype: str) -> None: ...
def register_save(id: str, driver) -> None: ...
def register_save_all(id: str, driver) -> None: ...
def register_extension(id: str, extension: str) -> None: ...
def register_extensions(id: str, extensions: Iterable[str]) -> None: ...
def registered_extensions() -> dict[str, str]: ...
def register_decoder(name: str, decoder) -> None: ...
def register_encoder(name: str, encoder) -> None: ...
def effect_mandelbrot(size: tuple[int, int], extent: tuple[float, float, float, float], quality: int) -> Image: ...
def effect_noise(size: tuple[int, int], sigma: float) -> Image: ...
def linear_gradient(mode: _Mode) -> Image: ...
def radial_gradient(mode: _Mode) -> Image: ...
class Exif(MutableMapping[int, Any]):
endian: Incomplete
bigtiff: bool
def load(self, data: bytes) -> None: ...
def load_from_fp(self, fp, offset: Incomplete | None = None) -> None: ...
def tobytes(self, offset: int = 8) -> bytes: ...
def get_ifd(self, tag: int): ...
def hide_offsets(self) -> None: ...
def __len__(self) -> int: ...
def __getitem__(self, tag: int) -> Any: ...
def __contains__(self, tag: object) -> bool: ...
def __setitem__(self, tag: int, value: Any) -> None: ...
def __delitem__(self, tag: int) -> None: ...
def __iter__(self) -> Iterator[int]: ...

View File

@@ -1,23 +0,0 @@
from .Image import Image
def constant(image: Image, value: int) -> Image: ...
def duplicate(image: Image) -> Image: ...
def invert(image: Image) -> Image: ...
def lighter(image1: Image, image2: Image) -> Image: ...
def darker(image1: Image, image2: Image) -> Image: ...
def difference(image1: Image, image2: Image) -> Image: ...
def multiply(image1: Image, image2: Image) -> Image: ...
def screen(image1: Image, image2: Image) -> Image: ...
def soft_light(image1: Image, image2: Image) -> Image: ...
def hard_light(image1: Image, image2: Image) -> Image: ...
def overlay(image1: Image, image2: Image) -> Image: ...
def add(image1: Image, image2: Image, scale: float = 1.0, offset: int = 0) -> Image: ...
def subtract(image1: Image, image2: Image, scale: float = 1.0, offset: int = 0) -> Image: ...
def add_modulo(image1: Image, image2: Image) -> Image: ...
def subtract_modulo(image1: Image, image2: Image) -> Image: ...
def logical_and(image1: Image, image2: Image) -> Image: ...
def logical_or(image1: Image, image2: Image) -> Image: ...
def logical_xor(image1: Image, image2: Image) -> Image: ...
def blend(image1: Image, image2: Image, alpha: float) -> Image: ...
def composite(image1: Image, image2: Image, mask: Image) -> Image: ...
def offset(image: Image, xoffset: int, yoffset: int | None = None) -> Image: ...

View File

@@ -1,84 +0,0 @@
import sys
from _typeshed import Incomplete, Unused
from enum import IntEnum
from .Image import ImagePointHandler
DESCRIPTION: str
VERSION: str
core: Incomplete
class Intent(IntEnum):
PERCEPTUAL = 0
RELATIVE_COLORIMETRIC = 1
SATURATION = 2
ABSOLUTE_COLORIMETRIC = 3
class Direction(IntEnum):
INPUT = 0
OUTPUT = 1
PROOF = 2
FLAGS: Incomplete
class ImageCmsProfile:
def __init__(self, profile) -> None: ...
def tobytes(self): ...
class ImageCmsTransform(ImagePointHandler):
transform: Incomplete
input_mode: Incomplete
output_mode: Incomplete
output_profile: Incomplete
def __init__(
self,
input,
output,
input_mode,
output_mode,
intent=...,
proof: Incomplete | None = None,
proof_intent=...,
flags: int = 0,
) -> None: ...
def point(self, im): ...
def apply(self, im, imOut: Incomplete | None = None): ...
def apply_in_place(self, im): ...
if sys.platform == "win32":
def get_display_profile(handle: Incomplete | None = None) -> ImageCmsProfile | None: ...
else:
def get_display_profile(handle: Unused = None) -> None: ...
class PyCMSError(Exception): ...
def profileToProfile(
im,
inputProfile,
outputProfile,
renderingIntent=...,
outputMode: Incomplete | None = None,
inPlace: bool = False,
flags: int = 0,
): ...
def getOpenProfile(profileFilename): ...
def buildTransform(inputProfile, outputProfile, inMode, outMode, renderingIntent=..., flags: int = 0): ...
def buildProofTransform(
inputProfile, outputProfile, proofProfile, inMode, outMode, renderingIntent=..., proofRenderingIntent=..., flags=16384
): ...
buildTransformFromOpenProfiles = buildTransform
buildProofTransformFromOpenProfiles = buildProofTransform
def applyTransform(im, transform, inPlace: bool = False): ...
def createProfile(colorSpace, colorTemp: int = -1): ...
def getProfileName(profile): ...
def getProfileInfo(profile): ...
def getProfileCopyright(profile): ...
def getProfileManufacturer(profile): ...
def getProfileModel(profile): ...
def getProfileDescription(profile): ...
def getDefaultIntent(profile): ...
def isIntentSupported(profile, intent, direction): ...
def versions(): ...

View File

@@ -1,10 +0,0 @@
from typing_extensions import TypeAlias
_RGB: TypeAlias = tuple[int, int, int] | tuple[int, int, int, int]
_Ink: TypeAlias = str | int | _RGB
_GreyScale: TypeAlias = tuple[int, int]
def getrgb(color: _Ink) -> _RGB: ...
def getcolor(color: _Ink, mode: str) -> _RGB | _GreyScale: ...
colormap: dict[str, str]

View File

@@ -1,155 +0,0 @@
from _typeshed import Incomplete
from collections.abc import Container, Sequence
from typing import Any, Literal, overload
from typing_extensions import TypeAlias
from .Image import Image
from .ImageColor import _Ink
from .ImageFont import _Font
_XY: TypeAlias = Sequence[float | tuple[float, float]]
_Outline: TypeAlias = Any
class ImageDraw:
font: Incomplete
palette: Incomplete
im: Incomplete
draw: Incomplete
mode: Incomplete
ink: Incomplete
fontmode: str
fill: bool
def __init__(self, im: Image, mode: str | None = None) -> None: ...
def getfont(self): ...
def arc(self, xy: _XY, start: float, end: float, fill: _Ink | None = None, width: float = 1) -> None: ...
def bitmap(self, xy: _XY, bitmap: Image, fill: _Ink | None = None) -> None: ...
def chord(
self, xy: _XY, start: float, end: float, fill: _Ink | None = None, outline: _Ink | None = None, width: float = 1
) -> None: ...
def ellipse(self, xy: _XY, fill: _Ink | None = None, outline: _Ink | None = None, width: float = 1) -> None: ...
def line(self, xy: _XY, fill: _Ink | None = None, width: float = 0, joint: Literal["curve"] | None = None) -> None: ...
def shape(self, shape: _Outline, fill: _Ink | None = None, outline: _Ink | None = None) -> None: ...
def pieslice(
self,
xy: tuple[tuple[float, float], tuple[float, float]],
start: float,
end: float,
fill: _Ink | None = None,
outline: _Ink | None = None,
width: float = 1,
) -> None: ...
def point(self, xy: _XY, fill: _Ink | None = None) -> None: ...
def polygon(self, xy: _XY, fill: _Ink | None = None, outline: _Ink | None = None, width: float = 1) -> None: ...
def regular_polygon(
self,
bounding_circle: tuple[float, float] | tuple[float, float, float] | list[int],
n_sides: int,
rotation: float = 0,
fill: _Ink | None = None,
outline: _Ink | None = None,
width: float = 1,
) -> None: ...
def rectangle(
self,
xy: tuple[float, float, float, float] | tuple[tuple[float, float], tuple[float, float]],
fill: _Ink | None = None,
outline: _Ink | None = None,
width: float = 1,
) -> None: ...
def rounded_rectangle(
self,
xy: tuple[float, float, float, float] | tuple[tuple[float, float], tuple[float, float]],
radius: float = 0,
fill: _Ink | None = None,
outline: _Ink | None = None,
width: float = 1,
*,
corners: tuple[bool, bool, bool, bool] | None = None,
) -> None: ...
def text(
self,
xy: tuple[float, float],
text: str | bytes,
fill: _Ink | None = None,
font: _Font | None = None,
anchor: str | None = None,
spacing: float = 4,
align: Literal["left", "center", "right"] = "left",
direction: Literal["rtl", "ltr", "ttb"] | None = None,
features: Sequence[str] | None = None,
language: str | None = None,
stroke_width: int = 0,
stroke_fill: _Ink | None = None,
embedded_color: bool = False,
*args,
**kwargs,
) -> None: ...
def multiline_text(
self,
xy: tuple[float, float],
text: str | bytes,
fill: _Ink | None = None,
font: _Font | None = None,
anchor: str | None = None,
spacing: float = 4,
align: Literal["left", "center", "right"] = "left",
direction: Literal["rtl", "ltr", "ttb"] | None = None,
features: Incomplete | None = None,
language: str | None = None,
stroke_width: int = 0,
stroke_fill: _Ink | None = None,
embedded_color: bool = False,
*,
font_size: int | None = None,
) -> None: ...
def textlength(
self,
text: str | bytes,
font: _Font | None = None,
direction: Literal["rtl", "ltr", "ttb"] | None = None,
features: Sequence[str] | None = None,
language: str | None = None,
embedded_color: bool = False,
*,
font_size: int | None = None,
) -> float: ...
def textbbox(
self,
xy: tuple[float, float],
text: str | bytes,
font: _Font | None = None,
anchor: str | None = None,
spacing: float = 4,
align: Literal["left", "center", "right"] = "left",
direction: Literal["rtl", "ltr", "ttb"] | None = None,
features: Incomplete | None = None,
language: str | None = None,
stroke_width: int = 0,
embedded_color: bool = False,
*,
font_size: int | None = None,
) -> tuple[int, int, int, int]: ...
def multiline_textbbox(
self,
xy: tuple[float, float],
text: str | bytes,
font: _Font | None = None,
anchor: str | None = None,
spacing: float = 4,
align: Literal["left", "center", "right"] = "left",
direction: Literal["rtl", "ltr", "ttb"] | None = None,
features: Incomplete | None = None,
language: str | None = None,
stroke_width: int = 0,
embedded_color: bool = False,
*,
font_size: int | None = None,
) -> tuple[int, int, int, int]: ...
def Draw(im: Image, mode: str | None = None) -> ImageDraw: ...
def Outline() -> _Outline: ...
@overload
def getdraw(im: None = None, hints: Container[Literal["nicest"]] | None = None) -> tuple[None, Any]: ...
@overload
def getdraw(im: Image, hints: Container[Literal["nicest"]] | None = None) -> tuple[Image, Any]: ...
def floodfill(image: Image, xy: tuple[float, float], value, border=None, thresh: float = 0) -> None: ...

View File

@@ -1,37 +0,0 @@
from _typeshed import Incomplete
from .Image import Image
from .ImageDraw import ImageDraw
class Pen:
color: Incomplete
width: Incomplete
def __init__(self, color, width: int = 1, opacity: int = 255) -> None: ...
class Brush:
color: Incomplete
def __init__(self, color, opacity: int = 255) -> None: ...
class Font:
color: Incomplete
font: Incomplete
def __init__(self, color, file, size: int = 12) -> None: ...
class Draw:
draw: ImageDraw
image: Image
transform: Incomplete | None
def __init__(self, image, size: Incomplete | None = None, color: Incomplete | None = None) -> None: ...
def flush(self) -> Image: ...
def render(self, op, xy, pen, brush: Incomplete | None = None) -> None: ...
def settransform(self, offset) -> None: ...
def arc(self, xy, start, end, *options) -> None: ...
def chord(self, xy, start, end, *options) -> None: ...
def ellipse(self, xy, *options) -> None: ...
def line(self, xy, *options) -> None: ...
def pieslice(self, xy, start, end, *options) -> None: ...
def polygon(self, xy, *options) -> None: ...
def rectangle(self, xy, *options) -> None: ...
def text(self, xy, text, font) -> None: ...
def textbbox(self, xy, text, font): ...
def textlength(self, text, font): ...

View File

@@ -1,25 +0,0 @@
from .Image import Image
class _Enhance:
def enhance(self, factor: float) -> Image: ...
class Color(_Enhance):
image: Image
intermediate_mode: str
degenerate: Image
def __init__(self, image: Image) -> None: ...
class Contrast(_Enhance):
image: Image
degenerate: Image
def __init__(self, image: Image) -> None: ...
class Brightness(_Enhance):
image: Image
degenerate: Image
def __init__(self, image: Image) -> None: ...
class Sharpness(_Enhance):
image: Image
degenerate: Image
def __init__(self, image: Image) -> None: ...

View File

@@ -1,89 +0,0 @@
from _typeshed import Incomplete, Unused
from typing import NoReturn
from typing_extensions import Self
from ._imaging import _PixelAccessor
from .Image import Image
MAXBLOCK: int
SAFEBLOCK: Incomplete
LOAD_TRUNCATED_IMAGES: bool
ERRORS: Incomplete
def raise_oserror(error) -> NoReturn: ...
class ImageFile(Image):
custom_mimetype: Incomplete
tile: list[Incomplete] | None
readonly: int
decoderconfig: Incomplete
decodermaxblock: Incomplete
fp: Incomplete
filename: Incomplete
def __init__(self, fp: Incomplete | None = None, filename: Incomplete | None = None) -> None: ...
def get_format_mimetype(self): ...
def verify(self) -> None: ...
map: Incomplete
im: Incomplete
def load(self) -> _PixelAccessor: ...
def load_prepare(self) -> None: ...
def load_end(self) -> None: ...
class StubImageFile(ImageFile):
def load(self) -> _PixelAccessor: ...
class Parser:
incremental: Incomplete | None
image: Incomplete | None
data: Incomplete | None
decoder: Incomplete | None
offset: int
finished: bool
def reset(self) -> None: ...
decode: Incomplete
def feed(self, data) -> None: ...
def __enter__(self) -> Self: ...
def __exit__(self, *args: Unused) -> None: ...
def close(self) -> Image: ...
class PyCodecState:
xsize: int
ysize: int
xoff: int
yoff: int
def extents(self) -> tuple[int, int, int, int]: ...
class PyCodec:
im: Incomplete
state: Incomplete
fd: Incomplete
mode: Incomplete
def __init__(self, mode, *args) -> None: ...
args: Incomplete
def init(self, args) -> None: ...
def cleanup(self) -> None: ...
def setfd(self, fd) -> None: ...
def setimage(self, im, extents: Incomplete | None = None) -> None: ...
class PyDecoder:
im: Incomplete
state: Incomplete
fd: Incomplete
mode: Incomplete
def __init__(self, mode, *args) -> None: ...
args: Incomplete
def init(self, args) -> None: ...
@property
def pulls_fd(self): ...
def decode(self, buffer) -> tuple[int, int]: ...
def cleanup(self) -> None: ...
def setfd(self, fd) -> None: ...
def setimage(self, im, extents: Incomplete | None = None) -> None: ...
def set_as_raw(self, data, rawmode: Incomplete | None = None) -> None: ...
class PyEncoder(PyCodec):
@property
def pushes_fd(self): ...
def encode(self, bufsize) -> None: ...
def encode_to_pyfd(self): ...
def encode_to_file(self, fh, bufsize): ...

View File

@@ -1,136 +0,0 @@
from _typeshed import Incomplete
from collections.abc import Callable, Iterable, Sequence
from typing import Literal
from typing_extensions import Self, TypeAlias
from .Image import Image
_FilterArgs: TypeAlias = tuple[Sequence[int], int, int, Sequence[int]]
# filter image parameters below are the C images, i.e. Image().im.
class Filter: ...
class MultibandFilter(Filter): ...
class BuiltinFilter(MultibandFilter):
def filter(self, image) -> Image: ...
class Kernel(BuiltinFilter):
name: str
filterargs: _FilterArgs
def __init__(self, size: Sequence[int], kernel: Sequence[int], scale: Incomplete | None = None, offset: int = 0) -> None: ...
class RankFilter(Filter):
name: str
size: int
rank: int
def __init__(self, size: int, rank: int) -> None: ...
def filter(self, image) -> Image: ...
class MedianFilter(RankFilter):
name: str
size: int
rank: int
def __init__(self, size: int = 3) -> None: ...
class MinFilter(RankFilter):
name: str
size: int
rank: int
def __init__(self, size: int = 3) -> None: ...
class MaxFilter(RankFilter):
name: str
size: int
rank: int
def __init__(self, size: int = 3) -> None: ...
class ModeFilter(Filter):
name: str
size: int
def __init__(self, size: int = 3) -> None: ...
def filter(self, image) -> Image: ...
class GaussianBlur(MultibandFilter):
name: str
radius: float
def __init__(self, radius: float = 2) -> None: ...
def filter(self, image) -> Image: ...
class BoxBlur(MultibandFilter):
name: str
radius: float
def __init__(self, radius: float) -> None: ...
def filter(self, image) -> Image: ...
class UnsharpMask(MultibandFilter):
name: str
radius: float
percent: int
threshold: int
def __init__(self, radius: float = 2, percent: int = 150, threshold: int = 3) -> None: ...
def filter(self, image) -> Image: ...
class BLUR(BuiltinFilter):
name: str
filterargs: _FilterArgs
class CONTOUR(BuiltinFilter):
name: str
filterargs: _FilterArgs
class DETAIL(BuiltinFilter):
name: str
filterargs: _FilterArgs
class EDGE_ENHANCE(BuiltinFilter):
name: str
filterargs: _FilterArgs
class EDGE_ENHANCE_MORE(BuiltinFilter):
name: str
filterargs: _FilterArgs
class EMBOSS(BuiltinFilter):
name: str
filterargs: _FilterArgs
class FIND_EDGES(BuiltinFilter):
name: str
filterargs: _FilterArgs
class SHARPEN(BuiltinFilter):
name: str
filterargs: _FilterArgs
class SMOOTH(BuiltinFilter):
name: str
filterargs: _FilterArgs
class SMOOTH_MORE(BuiltinFilter):
name: str
filterargs: _FilterArgs
class Color3DLUT(MultibandFilter):
name: str
size: list[int]
channels: int
mode: str | None
table: Incomplete
def __init__(self, size: int | Iterable[int], table, channels: int = 3, target_mode: str | None = None, **kwargs) -> None: ...
@classmethod
def generate(
cls,
size: int | tuple[int, int, int],
callback: Callable[[float, float, float], Iterable[float]],
channels: int = 3,
target_mode: str | None = None,
) -> Self: ...
def transform(
self,
callback: Callable[..., Iterable[float]],
with_normals: bool = False,
channels: Literal[3, 4] | None = None,
target_mode: Incomplete | None = None,
) -> Self: ...
def filter(self, image) -> Image: ...

View File

@@ -1,114 +0,0 @@
from _typeshed import FileDescriptorOrPath, Incomplete, SupportsRead
from enum import IntEnum
from pathlib import Path
from typing import Final, Literal, Protocol
from PIL.Image import Transpose
class Layout(IntEnum):
BASIC = 0
RAQM = 1
MAX_STRING_LENGTH: Final[int] = 1_000_000
class _Font(Protocol):
def getmask(self, text: str | bytes, mode: str = ..., /, direction=..., features=...): ...
class ImageFont:
def getmask(self, text: str | bytes, mode: str = "", direction=..., features=...): ...
def getbbox(self, text, *args, **kwargs): ...
def getlength(self, text, *args, **kwargs): ...
class FreeTypeFont:
path: str | bytes | Path | SupportsRead[bytes] | None
size: int
index: int
encoding: str
layout_engine: Layout
font_bytes: bytes # Only exists under some circumstances.
font: Incomplete
def __init__(
self,
font: str | bytes | Path | SupportsRead[bytes] | None = None,
size: int = 10,
index: int = 0,
encoding: str = "",
layout_engine: Layout | None = None,
) -> None: ...
def getname(self) -> tuple[str, str]: ...
def getmetrics(self) -> tuple[int, int]: ...
def getlength(
self,
text: str | bytes,
mode: str = "",
direction: Literal["ltr", "rtl", "ttb"] | None = None,
features: Incomplete | None = None,
language: str | None = None,
) -> float: ...
def getbbox(
self,
text: str | bytes,
mode: str = "",
direction=None,
features=None,
language: str | None = None,
stroke_width: int = 0,
anchor: str | None = None,
) -> tuple[int, int, int, int]: ...
def getmask(
self,
text: str | bytes,
mode: str = "",
direction: Literal["ltr", "rtl", "ttb"] | None = None,
features: Incomplete | None = None,
language: str | None = None,
stroke_width: float = 0,
anchor: str | None = None,
ink=0,
start: tuple[float, float] | None = None,
): ...
def getmask2(
self,
text: str | bytes,
mode: str = "",
direction: Literal["ltr", "rtl", "ttb"] | None = None,
features: Incomplete | None = None,
language: str | None = None,
stroke_width: float = 0,
anchor: str | None = None,
ink=0,
start: tuple[float, float] | None = None,
*args,
**kwargs,
): ...
def font_variant(
self,
font: str | bytes | Path | SupportsRead[bytes] | None = None,
size: int | None = None,
index: int | None = None,
encoding: str | None = None,
layout_engine: Layout | None = None,
) -> FreeTypeFont: ...
def get_variation_names(self): ...
def set_variation_by_name(self, name): ...
def get_variation_axes(self): ...
def set_variation_by_axes(self, axes): ...
class TransposedFont:
font: _Font
orientation: Transpose | None
def __init__(self, font: _Font, orientation: Transpose | None = None) -> None: ...
def getmask(self, text: str | bytes, mode: str = "", *args, **kwargs): ...
def getbbox(self, text, *args, **kwargs): ...
def getlength(self, text, *args, **kwargs): ...
def load(filename: FileDescriptorOrPath) -> ImageFont: ...
def truetype(
font: str | bytes | SupportsRead[bytes] | None = None,
size: int = 10,
index: int = 0,
encoding: str = "",
layout_engine: Layout | None = None,
) -> FreeTypeFont: ...
def load_path(filename: str | bytes) -> ImageFont: ...
def load_default(size: int | None = None) -> ImageFont: ...

View File

@@ -1,36 +0,0 @@
import sys
from _typeshed import Incomplete, Unused
from PIL.BmpImagePlugin import DibImageFile
from PIL.PngImagePlugin import PngImageFile
from .Image import Image, _Box
# include_layered_windows and all_screens are Windows only
# xdisplay must be None on non-linux platforms7
if sys.platform == "linux":
def grab(
bbox: _Box | None = None,
include_layered_windows: Unused = False,
all_screens: Unused = False,
xdisplay: Incomplete | None = None,
) -> Image: ...
elif sys.platform == "win32":
def grab(
bbox: _Box | None = None, include_layered_windows: bool = False, all_screens: bool = False, xdisplay: None = None
) -> Image: ...
else:
def grab(
bbox: _Box | None = None, include_layered_windows: Unused = False, all_screens: Unused = False, xdisplay: None = None
) -> Image: ...
if sys.platform == "darwin":
def grabclipboard() -> Image | None: ...
elif sys.platform == "win32":
def grabclipboard() -> list[str] | PngImageFile | DibImageFile | None: ...
else:
def grabclipboard() -> Image: ...

View File

@@ -1,49 +0,0 @@
from _typeshed import Incomplete
class _Operand:
im: Incomplete
def __init__(self, im) -> None: ...
def apply(self, op, im1, im2: Incomplete | None = None, mode: Incomplete | None = None): ...
def __bool__(self) -> bool: ...
def __abs__(self): ...
def __pos__(self): ...
def __neg__(self): ...
def __add__(self, other): ...
def __radd__(self, other): ...
def __sub__(self, other): ...
def __rsub__(self, other): ...
def __mul__(self, other): ...
def __rmul__(self, other): ...
def __truediv__(self, other): ...
def __rtruediv__(self, other): ...
def __mod__(self, other): ...
def __rmod__(self, other): ...
def __pow__(self, other): ...
def __rpow__(self, other): ...
def __invert__(self): ...
def __and__(self, other): ...
def __rand__(self, other): ...
def __or__(self, other): ...
def __ror__(self, other): ...
def __xor__(self, other): ...
def __rxor__(self, other): ...
def __lshift__(self, other): ...
def __rshift__(self, other): ...
def __eq__(self, other): ...
def __ne__(self, other): ...
def __lt__(self, other): ...
def __le__(self, other): ...
def __gt__(self, other): ...
def __ge__(self, other): ...
def imagemath_int(self): ...
def imagemath_float(self): ...
def imagemath_equal(self, other): ...
def imagemath_notequal(self, other): ...
def imagemath_min(self, other): ...
def imagemath_max(self, other): ...
def imagemath_convert(self, mode): ...
ops: Incomplete
def eval(expression, _dict={}, **kw): ...

View File

@@ -1,10 +0,0 @@
from _typeshed import Incomplete
class ModeDescriptor:
mode: Incomplete
bands: Incomplete
basemode: Incomplete
basetype: Incomplete
def __init__(self, mode, bands, basemode, basetype, typestr) -> None: ...
def getmode(mode): ...

View File

@@ -1,26 +0,0 @@
from _typeshed import StrOrBytesPath
from .Image import Image
LUT_SIZE: int
ROTATION_MATRIX: list[int]
MIRROR_MATRIX: list[int]
class LutBuilder:
patterns: list[str]
lut: bytearray
def __init__(self, patterns: list[str] | None = None, op_name: str | None = None) -> None: ...
def add_patterns(self, patterns: list[str]) -> None: ...
def build_default_lut(self) -> None: ...
def get_lut(self) -> bytearray: ...
def build_lut(self) -> bytearray: ...
class MorphOp:
lut: bytearray
def __init__(self, lut: bytearray | None = None, op_name: str | None = None, patterns: list[str] | None = None) -> None: ...
def apply(self, image: Image) -> tuple[int, Image]: ...
def match(self, image: Image) -> list[tuple[int, int]]: ...
def get_on_pixels(self, image: Image) -> list[tuple[int, int]]: ...
def load_lut(self, filename: StrOrBytesPath) -> None: ...
def save_lut(self, filename: StrOrBytesPath) -> None: ...
def set_lut(self, lut: bytearray) -> None: ...

View File

@@ -1,53 +0,0 @@
from _typeshed import Incomplete
from collections.abc import Iterable
from typing import Protocol
from typing_extensions import TypeAlias
from .Image import Image, Resampling, _Resample, _Size
from .ImageColor import _Ink
_Border: TypeAlias = int | tuple[int, int] | tuple[int, int, int, int]
class _Deformer(Protocol):
def getmesh(self, image: Image, /): ...
def autocontrast(
image: Image,
cutoff: float | tuple[float, float] = 0,
ignore: int | None = None,
mask: Image | None = None,
preserve_tone: bool = False,
) -> Image: ...
def colorize(
image: Image,
black: int | str,
white: int | str,
mid: int | str | None = None,
blackpoint: int = 0,
whitepoint: int = 255,
midpoint: int = 127,
) -> Image: ...
def contain(image: Image, size: _Size, method: Resampling | _Resample = ...) -> Image: ...
def cover(image: Image, size: _Size, method: Resampling | _Resample = ...) -> Image: ...
def pad(
image: Image,
size: _Size,
method: Resampling | _Resample = ...,
color: Incomplete | None = None,
centering: Iterable[float] = (0.5, 0.5),
) -> Image: ...
def crop(image: Image, border: _Border = 0) -> Image: ...
def scale(image: Image, factor: float, resample: Resampling | _Resample = ...) -> Image: ...
def deform(image: Image, deformer: _Deformer, resample: Resampling | _Resample = ...) -> Image: ...
def equalize(image: Image, mask: Incomplete | None = None) -> Image: ...
def expand(image: Image, border: _Border = 0, fill: _Ink = 0) -> Image: ...
def fit(
image: Image, size: _Size, method: Resampling | _Resample = ..., bleed: float = 0.0, centering: Iterable[float] = (0.5, 0.5)
) -> Image: ...
def flip(image: Image) -> Image: ...
def grayscale(image: Image) -> Image: ...
def invert(image: Image) -> Image: ...
def mirror(image: Image) -> Image: ...
def posterize(image: Image, bits: int) -> Image: ...
def solarize(image: Image, threshold: int = 128) -> Image: ...
def exif_transpose(image: Image, *, in_place: bool = False) -> Image: ...

View File

@@ -1,26 +0,0 @@
from _typeshed import Incomplete
from .Image import Image
class ImagePalette:
mode: Incomplete
rawmode: Incomplete
palette: Incomplete
colors: Incomplete
dirty: Incomplete
def __init__(self, mode: str = "RGB", palette: Incomplete | None = None) -> None: ...
def copy(self) -> ImagePalette: ...
def getdata(self): ...
def tobytes(self) -> bytes: ...
tostring = tobytes
def getcolor(self, color: tuple[int, int, int], image: Image | None = None) -> int: ...
def save(self, fp) -> None: ...
def raw(rawmode, data): ...
def make_linear_lut(black, white): ...
def make_gamma_lut(exp): ...
def negative(mode: str = "RGB"): ...
def random(mode: str = "RGB"): ...
def sepia(white: str = "#fff0c0"): ...
def wedge(mode: str = "RGB"): ...
def load(filename): ...

View File

@@ -1,3 +0,0 @@
from ._imaging import path
Path = path

View File

@@ -1,26 +0,0 @@
from _typeshed import Incomplete
from typing import Any, Literal
from typing_extensions import TypeAlias
from .Image import Image
# imported from either of {PyQt6,PySide6,PyQt5,PySide2}.QtGui
# These are way too complex, with 4 different possible sources (2 deprecated)
# And we don't want to force the user to install PyQt or Pyside when they may not even use it.
_QImage: TypeAlias = Any
_QPixmap: TypeAlias = Any
qt_versions: Incomplete
qt_is_installed: bool
qt_version: Incomplete
def rgb(r: int, g: int, b: int, a: int = 255) -> int: ...
def fromqimage(im: ImageQt | _QImage) -> Image: ...
def fromqpixmap(im: ImageQt | _QImage) -> Image: ...
def align8to32(bytes: bytes, width: int, mode: Literal["1", "L", "P"]) -> bytes: ...
class ImageQt(_QImage):
def __init__(self, im: Image) -> None: ...
def toqimage(im: Image) -> ImageQt: ...
def toqpixmap(im: Image) -> _QPixmap: ...

View File

@@ -1,14 +0,0 @@
from collections.abc import Callable
from typing_extensions import Self
from .Image import Image
class Iterator:
im: Image
position: int
def __init__(self, im: Image) -> None: ...
def __getitem__(self, ix: int) -> Image: ...
def __iter__(self) -> Self: ...
def __next__(self) -> Image: ...
def all_frames(im: Image | list[Image], func: Callable[[Image], Image] | None = None) -> list[Image]: ...

View File

@@ -1,58 +0,0 @@
from _typeshed import Incomplete, Unused
from typing import Any, Literal
def register(viewer, order: int = 1) -> None: ...
def show(image, title: Incomplete | None = None, **options): ...
class Viewer:
def show(self, image, **options): ...
format: Incomplete
options: Incomplete
def get_format(self, image): ...
# Abstract method
def get_command(self, file: str, **options: Any) -> str: ...
def save_image(self, image): ...
def show_image(self, image, **options): ...
def show_file(self, path: str, **options: Any) -> Literal[1]: ...
class WindowsViewer(Viewer):
format: str
options: Incomplete
def get_command(self, file: str, **options: Unused) -> str: ...
class MacViewer(Viewer):
format: str
options: Incomplete
def get_command(self, file: str, **options: Unused) -> str: ...
def show_file(self, path: str, **options: Unused) -> Literal[1]: ...
class UnixViewer(Viewer):
format: str
options: Incomplete
# Unix viewer expects the following method to be implemented on all
# subclasses, but it isn't defined on the base class.
# def get_command_ex(self, file: str, **options: Any) -> tuple[str, str]: ...
def get_command(self, file: str, **options: Any) -> str: ...
class XDGViewer(UnixViewer):
def get_command_ex(self, file: str, **options: Unused) -> tuple[str, str]: ...
def show_file(self, path: str, **options: Unused) -> Literal[1]: ...
class DisplayViewer(UnixViewer):
def get_command_ex(self, file: str, title: str | None = None, **options: Unused) -> tuple[str, str]: ...
def show_file(self, path: str, *, title: str | None = None, **options: Unused) -> Literal[1]: ...
class GmDisplayViewer(UnixViewer):
def get_command_ex(self, file: str, **options: Unused) -> tuple[str, str]: ...
def show_file(self, path: str, **options: Unused) -> Literal[1]: ...
class EogViewer(UnixViewer):
def get_command_ex(self, file: str, **options: Unused) -> tuple[str, str]: ...
def show_file(self, path: str, **options: Unused) -> Literal[1]: ...
class XVViewer(UnixViewer):
def get_command_ex(self, file, title: str | None = None, **options: Unused) -> tuple[str, str]: ...
def show_file(self, path: str, *, title: str | None = None, **options: Unused) -> Literal[1]: ...
class IPythonViewer(Viewer):
def show_image(self, image, **options: Unused) -> Literal[1]: ...

View File

@@ -1,14 +0,0 @@
from _typeshed import Incomplete
class Stat:
h: Incomplete
bands: Incomplete
count: list[int]
mean: list[float]
rms: list[float]
stddev: list[float]
var: list[float]
def __init__(self, image_or_list, mask: Incomplete | None = None) -> None: ...
def __getattr__(self, id: str): ...
Global = Stat

View File

@@ -1,51 +0,0 @@
import _tkinter
import tkinter
from _typeshed import ReadableBuffer, StrOrBytesPath, SupportsRead
from typing import Any
from PIL.Image import Image
class PhotoImage(tkinter._PhotoImageLike):
tk: _tkinter.TkappType
def __init__(
self,
image: Image | str | None = None,
size: tuple[int, int] | None = None,
*,
file: StrOrBytesPath | SupportsRead[bytes] = ...,
data: ReadableBuffer = ...,
# These are forwarded to tkinter.PhotoImage.__init__():
name: str | None = None,
cnf: dict[str, Any] = ...,
format: str = ...,
gamma: float = ...,
height: int = ...,
palette: int | str = ...,
width: int = ...,
) -> None: ...
def __del__(self) -> None: ...
def width(self) -> int: ...
def height(self) -> int: ...
def paste(self, im: Image) -> None: ...
class BitmapImage(tkinter._BitmapImageLike):
def __init__(
self,
image: Image | None = None,
*,
file: StrOrBytesPath | SupportsRead[bytes] = ...,
data: ReadableBuffer = ...,
# These are forwarded to tkinter.Bitmap.__init__():
name: str | None = None,
cnf: dict[str, Any] = ...,
master: tkinter.Misc | _tkinter.TkappType | None = None,
background: str = ...,
foreground: str = ...,
maskdata: str = ...,
maskfile: StrOrBytesPath = ...,
) -> None: ...
def __del__(self) -> None: ...
def width(self) -> int: ...
def height(self) -> int: ...
def getimage(photo: tkinter.PhotoImage) -> Image: ...

View File

@@ -1,21 +0,0 @@
from _typeshed import Incomplete
from .Image import ImageTransformHandler
class Transform(ImageTransformHandler):
data: Incomplete
def __init__(self, data) -> None: ...
def getdata(self): ...
def transform(self, size, image, **options): ...
class AffineTransform(Transform):
method: Incomplete
class ExtentTransform(Transform):
method: Incomplete
class QuadTransform(Transform):
method: Incomplete
class MeshTransform(Transform):
method: Incomplete

View File

@@ -1,38 +0,0 @@
from _typeshed import Incomplete
class HDC:
dc: Incomplete
def __init__(self, dc) -> None: ...
def __int__(self) -> int: ...
class HWND:
wnd: Incomplete
def __init__(self, wnd) -> None: ...
def __int__(self) -> int: ...
class Dib:
image: Incomplete
mode: Incomplete
size: Incomplete
def __init__(self, image, size: Incomplete | None = None) -> None: ...
def expose(self, handle): ...
def draw(self, handle, dst, src: Incomplete | None = None): ...
def query_palette(self, handle): ...
def paste(self, im, box: Incomplete | None = None) -> None: ...
def frombytes(self, buffer): ...
def tobytes(self): ...
class Window:
hwnd: Incomplete
def __init__(self, title: str = "PIL", width: Incomplete | None = None, height: Incomplete | None = None) -> None: ...
def ui_handle_clear(self, dc, x0, y0, x1, y1) -> None: ...
def ui_handle_damage(self, x0, y0, x1, y1) -> None: ...
def ui_handle_destroy(self) -> None: ...
def ui_handle_repair(self, dc, x0, y0, x1, y1) -> None: ...
def ui_handle_resize(self, width, height) -> None: ...
def mainloop(self) -> None: ...
class ImageWindow(Window):
image: Incomplete
def __init__(self, image, title: str = "PIL") -> None: ...
def ui_handle_repair(self, dc, x0, y0, x1, y1) -> None: ...

View File

@@ -1,10 +0,0 @@
from _typeshed import Incomplete
from typing import ClassVar, Literal
from .ImageFile import ImageFile
field: Incomplete
class ImtImageFile(ImageFile):
format: ClassVar[Literal["IMT"]]
format_description: ClassVar[str]

View File

@@ -1,23 +0,0 @@
from collections.abc import Iterable
from typing import ClassVar, Final, Literal
from typing_extensions import deprecated
from ._imaging import _PixelAccessor
from .ImageFile import ImageFile
COMPRESSION: dict[int, str]
PAD: Final[bytes]
@deprecated("Deprecated since 10.2.0")
def i(c: bytes) -> int: ...
@deprecated("Deprecated since 10.2.0")
def dump(c: Iterable[int | bytes]) -> None: ...
class IptcImageFile(ImageFile):
format: ClassVar[Literal["IPTC"]]
format_description: ClassVar[str]
def getint(self, key: tuple[int, int]) -> int: ...
def field(self) -> tuple[tuple[int, int] | None, int]: ...
def load(self) -> _PixelAccessor: ...
def getiptcinfo(im): ...

View File

@@ -1,23 +0,0 @@
from _typeshed import Incomplete
from typing import ClassVar, Literal
from ._imaging import _PixelAccessor
from .ImageFile import ImageFile
class BoxReader:
fp: Incomplete
has_length: Incomplete
length: Incomplete
remaining_in_box: int
def __init__(self, fp, length: int = -1) -> None: ...
def read_fields(self, field_format): ...
def read_boxes(self): ...
def has_next_box(self): ...
def next_box_type(self): ...
class Jpeg2KImageFile(ImageFile):
format: ClassVar[Literal["JPEG2000"]]
format_description: ClassVar[str]
reduce: Incomplete
tile: Incomplete
def load(self) -> _PixelAccessor: ...

View File

@@ -1,30 +0,0 @@
from _typeshed import Incomplete
from typing import ClassVar, Literal
from .ImageFile import ImageFile
def Skip(self, marker) -> None: ...
def APP(self, marker) -> None: ...
def COM(self, marker) -> None: ...
def SOF(self, marker) -> None: ...
def DQT(self, marker) -> None: ...
MARKER: Incomplete
class JpegImageFile(ImageFile):
format: ClassVar[Literal["JPEG", "MPO"]]
format_description: ClassVar[str]
def load_read(self, read_bytes): ...
tile: Incomplete
decoderconfig: Incomplete
def draft(self, mode, size): ...
im: Incomplete
def load_djpeg(self) -> None: ...
def getxmp(self): ...
RAWMODE: Incomplete
zigzag_index: Incomplete
samplings: Incomplete
def get_sampling(im): ...
def jpeg_factory(fp: Incomplete | None = None, filename: Incomplete | None = None): ...

View File

@@ -1,3 +0,0 @@
from _typeshed import Incomplete
presets: Incomplete

View File

@@ -1,7 +0,0 @@
from typing import ClassVar, Literal
from .ImageFile import ImageFile
class McIdasImageFile(ImageFile):
format: ClassVar[Literal["MCIDAS"]]
format_description: ClassVar[str]

View File

@@ -1,18 +0,0 @@
from typing import Any, ClassVar, Literal
from typing_extensions import TypeAlias
from .TiffImagePlugin import TiffImageFile
_OleFileIO: TypeAlias = Any # olefile.OleFileIO
_OleStream: TypeAlias = Any # olefile.OleStream
class MicImageFile(TiffImageFile):
ole: _OleFileIO
format: ClassVar[Literal["MIC"]]
format_description: ClassVar[str]
fp: _OleStream
frame: int | None
images: list[list[str]]
is_animated: bool
def seek(self, frame: int) -> None: ...
def tell(self) -> int | None: ... # type: ignore[override]

View File

@@ -1,18 +0,0 @@
from _typeshed import Incomplete
from typing import ClassVar, Literal
from .ImageFile import ImageFile
class BitStream:
fp: Incomplete
bits: int
bitbuffer: int
def __init__(self, fp) -> None: ...
def next(self): ...
def peek(self, bits): ...
def skip(self, bits) -> None: ...
def read(self, bits): ...
class MpegImageFile(ImageFile):
format: ClassVar[Literal["MPEG"]]
format_description: ClassVar[str]

View File

@@ -1,15 +0,0 @@
from _typeshed import Incomplete
from typing import ClassVar, Literal
from .JpegImagePlugin import JpegImageFile
class MpoImageFile(JpegImageFile):
format: ClassVar[Literal["MPO"]]
def load_seek(self, pos) -> None: ...
fp: Incomplete
offset: Incomplete
tile: Incomplete
def seek(self, frame) -> None: ...
def tell(self): ...
@staticmethod
def adopt(jpeg_instance, mpheader: Incomplete | None = None): ...

View File

@@ -1,10 +0,0 @@
from typing import ClassVar, Literal
from .ImageFile import ImageFile, PyDecoder
class MspImageFile(ImageFile):
format: ClassVar[Literal["MSP"]]
format_description: ClassVar[str]
class MspDecoder(PyDecoder):
def decode(self, buffer): ...

View File

@@ -1,19 +0,0 @@
from _typeshed import SupportsWrite, Unused
from .Image import Image
class PSDraw:
fp: SupportsWrite[bytes]
def __init__(self, fp: SupportsWrite[bytes] | None = None) -> None: ...
isofont: dict[bytes, int]
def begin_document(self, id: Unused = None) -> None: ...
def end_document(self) -> None: ...
def setfont(self, font: str, size: int) -> None: ...
def line(self, xy0: tuple[int, int], xy1: tuple[int, int]) -> None: ...
def rectangle(self, box: tuple[int, int, int, int]) -> None: ...
def text(self, xy: tuple[int, int], text: str) -> None: ...
def image(self, box: tuple[int, int, int, int], im: Image, dpi: float | None = None) -> None: ...
EDROFF_PS: bytes
VDI_PS: bytes
ERROR_PS: bytes

View File

@@ -1,7 +0,0 @@
from _typeshed import Incomplete
class PaletteFile:
rawmode: str
palette: Incomplete
def __init__(self, fp) -> None: ...
def getpalette(self): ...

View File

@@ -1,5 +0,0 @@
from _typeshed import Incomplete
def build_prototype_image(): ...
Palm8BitColormapImage: Incomplete

View File

@@ -1,10 +0,0 @@
from _typeshed import Incomplete
from typing import ClassVar, Literal
from .ImageFile import ImageFile
class PcdImageFile(ImageFile):
format: ClassVar[Literal["PCD"]]
format_description: ClassVar[str]
im: Incomplete
def load_end(self) -> None: ...

View File

@@ -1,25 +0,0 @@
from _typeshed import Incomplete
from .FontFile import FontFile
PCF_MAGIC: int
PCF_PROPERTIES: Incomplete
PCF_ACCELERATORS: Incomplete
PCF_METRICS: Incomplete
PCF_BITMAPS: Incomplete
PCF_INK_METRICS: Incomplete
PCF_BDF_ENCODINGS: Incomplete
PCF_SWIDTHS: Incomplete
PCF_GLYPH_NAMES: Incomplete
PCF_BDF_ACCELERATORS: Incomplete
BYTES_PER_ROW: Incomplete
def sz(s, o): ...
class PcfFontFile(FontFile):
name: str
charset_encoding: Incomplete
toc: Incomplete
fp: Incomplete
info: Incomplete
def __init__(self, fp, charset_encoding: str = "iso8859-1") -> None: ...

View File

@@ -1,10 +0,0 @@
from _typeshed import Incomplete
from typing import ClassVar, Literal
from .ImageFile import ImageFile
class PcxImageFile(ImageFile):
format: ClassVar[Literal["PCX", "DCX"]]
format_description: ClassVar[str]
SAVE: Incomplete

View File

@@ -1,167 +0,0 @@
import collections
from _typeshed import Incomplete
from types import TracebackType
from typing import Any, Literal
def encode_text(s: str) -> bytes: ...
PDFDocEncoding: dict[int, str]
def decode_text(b: bytes) -> str: ...
class PdfFormatError(RuntimeError): ...
def check_format_condition(condition, error_message) -> None: ...
class IndirectReference:
def __bytes__(self) -> bytes: ...
def __eq__(self, other): ...
def __ne__(self, other): ...
def __hash__(self) -> int: ...
class IndirectObjectDef(IndirectReference): ...
class XrefTable:
existing_entries: Incomplete
new_entries: Incomplete
deleted_entries: Incomplete
reading_finished: bool
def __init__(self) -> None: ...
def __setitem__(self, key, value) -> None: ...
def __getitem__(self, key): ...
def __delitem__(self, key) -> None: ...
def __contains__(self, key): ...
def __len__(self) -> int: ...
def keys(self): ...
def write(self, f): ...
class PdfName:
name: Incomplete
def __init__(self, name) -> None: ...
def name_as_str(self): ...
def __eq__(self, other): ...
def __hash__(self) -> int: ...
@classmethod
def from_pdf_stream(cls, data): ...
allowed_chars: Incomplete
def __bytes__(self) -> bytes: ...
class PdfArray(list[Any]):
def __bytes__(self) -> bytes: ...
class PdfDict(collections.UserDict[bytes, Any]):
def __setattr__(self, key: str, value) -> None: ...
def __getattr__(self, key: str): ...
def __bytes__(self) -> bytes: ...
class PdfBinary:
data: Incomplete
def __init__(self, data) -> None: ...
def __bytes__(self) -> bytes: ...
class PdfStream:
dictionary: Incomplete
buf: Incomplete
def __init__(self, dictionary, buf) -> None: ...
def decode(self): ...
def pdf_repr(x) -> bytes: ...
class PdfParser:
filename: Incomplete
buf: Incomplete
f: Incomplete
start_offset: Incomplete
should_close_buf: bool
should_close_file: bool
cached_objects: Incomplete
file_size_total: int
root: Incomplete
root_ref: Incomplete
info: Incomplete
info_ref: Incomplete
page_tree_root: Incomplete
pages: Incomplete
orig_pages: Incomplete
pages_ref: Incomplete
last_xref_section_offset: Incomplete
trailer_dict: Incomplete
xref_table: Incomplete
def __init__(
self,
filename: Incomplete | None = None,
f: Incomplete | None = None,
buf: Incomplete | None = None,
start_offset: int = 0,
mode: str = "rb",
) -> None: ...
def __enter__(self): ...
def __exit__(
self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None
) -> Literal[False]: ...
def start_writing(self) -> None: ...
def close_buf(self) -> None: ...
def close(self) -> None: ...
def seek_end(self) -> None: ...
def write_header(self) -> None: ...
def write_comment(self, s) -> None: ...
def write_catalog(self): ...
def rewrite_pages(self) -> None: ...
def write_xref_and_trailer(self, new_root_ref: Incomplete | None = None) -> None: ...
def write_page(self, ref, *objs, **dict_obj): ...
def write_obj(self, ref, *objs, **dict_obj): ...
def del_root(self) -> None: ...
@staticmethod
def get_buf_from_file(f): ...
file_size_this: Incomplete
def read_pdf_info(self) -> None: ...
def next_object_id(self, offset: Incomplete | None = None): ...
delimiter: bytes
delimiter_or_ws: bytes
whitespace: bytes
whitespace_or_hex: bytes
whitespace_optional: Incomplete
whitespace_mandatory: Incomplete
whitespace_optional_no_nl: bytes
newline_only: bytes
newline: Incomplete
re_trailer_end: Incomplete
re_trailer_prev: Incomplete
def read_trailer(self) -> None: ...
def read_prev_trailer(self, xref_section_offset) -> None: ...
re_whitespace_optional: Incomplete
re_name: Incomplete
re_dict_start: Incomplete
re_dict_end: Incomplete
@classmethod
def interpret_trailer(cls, trailer_data): ...
re_hashes_in_name: Incomplete
@classmethod
def interpret_name(cls, raw, as_text: bool = False): ...
re_null: Incomplete
re_true: Incomplete
re_false: Incomplete
re_int: Incomplete
re_real: Incomplete
re_array_start: Incomplete
re_array_end: Incomplete
re_string_hex: Incomplete
re_string_lit: Incomplete
re_indirect_reference: Incomplete
re_indirect_def_start: Incomplete
re_indirect_def_end: Incomplete
re_comment: Incomplete
re_stream_start: Incomplete
re_stream_end: Incomplete
@classmethod
def get_value(cls, data, offset, expect_indirect: Incomplete | None = None, max_nesting: int = -1): ...
re_lit_str_token: Incomplete
escaped_chars: Incomplete
@classmethod
def get_literal_string(cls, data, offset): ...
re_xref_section_start: Incomplete
re_xref_subsection_start: Incomplete
re_xref_entry: Incomplete
def read_xref_table(self, xref_section_offset): ...
def read_indirect(self, ref, max_nesting: int = -1): ...
def linearize_page_tree(self, node: Incomplete | None = None): ...

View File

@@ -1,7 +0,0 @@
from typing import ClassVar, Literal
from .ImageFile import ImageFile
class PixarImageFile(ImageFile):
format: ClassVar[Literal["PIXAR"]]
format_description: ClassVar[str]

View File

@@ -1,115 +0,0 @@
from _typeshed import Incomplete, Unused
from enum import IntEnum
from typing import ClassVar, Literal
from ._binary import o8 as o8
from .ImageFile import ImageFile
is_cid: Incomplete
MAX_TEXT_CHUNK: Incomplete
MAX_TEXT_MEMORY: Incomplete
class Disposal(IntEnum):
OP_NONE = 0
OP_BACKGROUND = 1
OP_PREVIOUS = 2
class Blend(IntEnum):
OP_SOURCE = 0
OP_OVER = 1
class ChunkStream:
fp: Incomplete
queue: Incomplete
def __init__(self, fp) -> None: ...
def read(self): ...
def __enter__(self): ...
def __exit__(self, *args: Unused) -> None: ...
def close(self) -> None: ...
def push(self, cid, pos, length) -> None: ...
def call(self, cid, pos, length): ...
def crc(self, cid, data) -> None: ...
def crc_skip(self, cid, data) -> None: ...
def verify(self, endchunk: bytes = b"IEND"): ...
class iTXt(str):
lang: Incomplete
tkey: Incomplete
@staticmethod
def __new__(cls, text, lang: Incomplete | None = None, tkey: Incomplete | None = None): ...
class PngInfo:
chunks: Incomplete
def __init__(self) -> None: ...
def add(self, cid, data, after_idat: bool = False) -> None: ...
def add_itxt(self, key, value, lang: str = "", tkey: str = "", zip: bool = False) -> None: ...
def add_text(self, key, value, zip: bool = False): ...
class PngStream(ChunkStream):
im_info: Incomplete
im_text: Incomplete
im_size: Incomplete
im_mode: Incomplete
im_tile: Incomplete
im_palette: Incomplete
im_custom_mimetype: Incomplete
im_n_frames: Incomplete
rewind_state: Incomplete
text_memory: int
def __init__(self, fp) -> None: ...
def check_text_memory(self, chunklen) -> None: ...
def save_rewind(self) -> None: ...
def rewind(self) -> None: ...
def chunk_iCCP(self, pos, length): ...
def chunk_IHDR(self, pos, length): ...
im_idat: Incomplete
def chunk_IDAT(self, pos, length) -> None: ...
def chunk_IEND(self, pos, length) -> None: ...
def chunk_PLTE(self, pos, length): ...
def chunk_tRNS(self, pos, length): ...
def chunk_gAMA(self, pos, length): ...
def chunk_cHRM(self, pos, length): ...
def chunk_sRGB(self, pos, length): ...
def chunk_pHYs(self, pos, length): ...
def chunk_tEXt(self, pos, length): ...
def chunk_zTXt(self, pos, length): ...
def chunk_iTXt(self, pos, length): ...
def chunk_eXIf(self, pos, length): ...
def chunk_acTL(self, pos, length): ...
def chunk_fcTL(self, pos, length): ...
def chunk_fdAT(self, pos, length): ...
class PngImageFile(ImageFile):
format: ClassVar[Literal["PNG"]]
format_description: ClassVar[str]
@property
def text(self): ...
fp: Incomplete
def verify(self) -> None: ...
def seek(self, frame) -> None: ...
def tell(self): ...
decoderconfig: Incomplete
def load_prepare(self) -> None: ...
def load_read(self, read_bytes): ...
png: Incomplete
im: Incomplete
def load_end(self) -> None: ...
def getexif(self): ...
def getxmp(self): ...
def putchunk(fp, cid, *data) -> None: ...
class _idat:
fp: Incomplete
chunk: Incomplete
def __init__(self, fp, chunk) -> None: ...
def write(self, data) -> None: ...
class _fdat:
fp: Incomplete
chunk: Incomplete
seq_num: Incomplete
def __init__(self, fp, chunk, seq_num) -> None: ...
def write(self, data) -> None: ...
def getchunks(im, **params): ...

View File

@@ -1,17 +0,0 @@
from _typeshed import Incomplete
from typing import ClassVar, Literal
from .ImageFile import ImageFile, PyDecoder
b_whitespace: bytes
MODES: Incomplete
class PpmImageFile(ImageFile):
format: ClassVar[Literal["PPM"]]
format_description: ClassVar[str]
class PpmPlainDecoder(PyDecoder):
def decode(self, buffer): ...
class PpmDecoder(PyDecoder):
def decode(self, buffer): ...

View File

@@ -1,17 +0,0 @@
from _typeshed import Incomplete
from typing import ClassVar, Literal
from .ImageFile import ImageFile
MODES: Incomplete
class PsdImageFile(ImageFile):
format: ClassVar[Literal["PSD"]]
format_description: ClassVar[str]
tile: Incomplete
frame: Incomplete
fp: Incomplete
def seek(self, layer): ...
def tell(self): ...
im: Incomplete
def load_prepare(self) -> None: ...

View File

@@ -1,69 +0,0 @@
from _typeshed import Incomplete
from typing import Protocol
ffi: Incomplete
# Copy of PIL._imaging.PixelAccess.
# See https://github.com/python/typeshed/issues/11688.
class _PixelAccessor(Protocol):
def __setitem__(self, xy: tuple[int, int], color, /) -> None: ...
def __getitem__(self, xy: tuple[int, int], /): ...
def putpixel(self, xy: tuple[int, int], color, /) -> None: ...
def getpixel(self, xy: tuple[int, int], /): ...
class PyAccess(_PixelAccessor):
readonly: Incomplete
image8: Incomplete
image32: Incomplete
image: Incomplete
def __init__(self, img, readonly: bool = False) -> None: ...
def __setitem__(self, xy: tuple[int, int], color) -> None: ...
def __getitem__(self, xy: tuple[int, int]): ...
def putpixel(self, xy: tuple[int, int], color) -> None: ...
def getpixel(self, xy: tuple[int, int]): ...
def check_xy(self, xy: tuple[int, int]): ...
class _PyAccess32_2(PyAccess):
def get_pixel(self, x, y): ...
def set_pixel(self, x, y, color) -> None: ...
class _PyAccess32_3(PyAccess):
def get_pixel(self, x, y): ...
def set_pixel(self, x, y, color) -> None: ...
class _PyAccess32_4(PyAccess):
def get_pixel(self, x, y): ...
def set_pixel(self, x, y, color) -> None: ...
class _PyAccess8(PyAccess):
def get_pixel(self, x, y): ...
def set_pixel(self, x, y, color) -> None: ...
class _PyAccessI16_N(PyAccess):
def get_pixel(self, x, y): ...
def set_pixel(self, x, y, color) -> None: ...
class _PyAccessI16_L(PyAccess):
def get_pixel(self, x, y): ...
def set_pixel(self, x, y, color) -> None: ...
class _PyAccessI16_B(PyAccess):
def get_pixel(self, x, y): ...
def set_pixel(self, x, y, color) -> None: ...
class _PyAccessI32_N(PyAccess):
def get_pixel(self, x, y): ...
def set_pixel(self, x, y, color) -> None: ...
class _PyAccessI32_Swap(PyAccess):
def reverse(self, i): ...
def get_pixel(self, x, y): ...
def set_pixel(self, x, y, color) -> None: ...
class _PyAccessF(PyAccess):
def get_pixel(self, x, y): ...
def set_pixel(self, x, y, color) -> None: ...
mode_map: Incomplete
def new(img, readonly: bool = False): ...

View File

@@ -1,11 +0,0 @@
from typing import ClassVar
from . import Image as Image, ImageFile as ImageFile
from ._binary import o8 as o8
class QoiImageFile(ImageFile.ImageFile):
format: ClassVar[str]
format_description: ClassVar[str]
class QoiDecoder(ImageFile.PyDecoder):
def decode(self, buffer): ...

View File

@@ -1,13 +0,0 @@
from _typeshed import Incomplete
from typing import ClassVar, Literal
from .ImageFile import ImageFile, PyDecoder
MODES: Incomplete
class SgiImageFile(ImageFile):
format: ClassVar[Literal["SGI"]]
format_description: ClassVar[str]
class SGI16Decoder(PyDecoder):
def decode(self, buffer): ...

View File

@@ -1,28 +0,0 @@
from _typeshed import Incomplete
from typing import ClassVar, Literal
from .ImageFile import ImageFile
def isInt(f: object) -> Literal[0, 1]: ...
iforms: Incomplete
def isSpiderHeader(t): ...
def isSpiderImage(filename): ...
class SpiderImageFile(ImageFile):
format: ClassVar[Literal["SPIDER"]]
format_description: ClassVar[str]
@property
def n_frames(self): ...
@property
def is_animated(self): ...
def tell(self): ...
stkoffset: Incomplete
fp: Incomplete
def seek(self, frame) -> None: ...
def convert2byte(self, depth: int = 255): ...
def tkPhotoImage(self): ...
def loadImageSeries(filelist: Incomplete | None = None): ...
def makeSpiderHeader(im): ...

View File

@@ -1,7 +0,0 @@
from typing import ClassVar, Literal
from .ImageFile import ImageFile
class SunImageFile(ImageFile):
format: ClassVar[Literal["SUN"]]
format_description: ClassVar[str]

View File

@@ -1,12 +0,0 @@
from types import TracebackType
from typing_extensions import Self
from .ContainerIO import ContainerIO
class TarIO(ContainerIO[bytes]):
def __init__(self, tarfile: str, file: str) -> None: ...
def __enter__(self) -> Self: ...
def __exit__(
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
) -> None: ...
def close(self) -> None: ...

View File

@@ -1,12 +0,0 @@
from _typeshed import Incomplete
from typing import ClassVar, Literal
from .ImageFile import ImageFile
MODES: Incomplete
class TgaImageFile(ImageFile):
format: ClassVar[Literal["TGA"]]
format_description: ClassVar[str]
SAVE: Incomplete

View File

@@ -1,295 +0,0 @@
import sys
from _typeshed import Incomplete
from collections.abc import Callable, MutableMapping
from fractions import Fraction, _ComparableNum
from numbers import Rational
from types import TracebackType
from typing import ClassVar, Final, Literal, SupportsIndex, overload
from typing_extensions import TypeAlias
from ._imaging import _PixelAccessor
from .ImageFile import ImageFile
_OpenInfo: TypeAlias = tuple[Literal[b"II", b"MM"], int, tuple[int, ...], int, tuple[int, ...], tuple[int, ...]]
# These are meant to be overridable
READ_LIBTIFF: bool
WRITE_LIBTIFF: bool
IFD_LEGACY_API: bool
STRIP_SIZE: int
II: Final = b"II"
MM: Final = b"MM"
IMAGEWIDTH: Final = 256
IMAGELENGTH: Final = 257
BITSPERSAMPLE: Final = 258
COMPRESSION: Final = 259
PHOTOMETRIC_INTERPRETATION: Final = 262
FILLORDER: Final = 266
IMAGEDESCRIPTION: Final = 270
STRIPOFFSETS: Final = 273
SAMPLESPERPIXEL: Final = 277
ROWSPERSTRIP: Final = 278
STRIPBYTECOUNTS: Final = 279
X_RESOLUTION: Final = 282
Y_RESOLUTION: Final = 283
PLANAR_CONFIGURATION: Final = 284
RESOLUTION_UNIT: Final = 296
TRANSFERFUNCTION: Final = 301
SOFTWARE: Final = 305
DATE_TIME: Final = 306
ARTIST: Final = 315
PREDICTOR: Final = 317
COLORMAP: Final = 320
TILEWIDTH: Final = 322
TILELENGTH: Final = 323
TILEOFFSETS: Final = 324
TILEBYTECOUNTS: Final = 325
SUBIFD: Final = 330
EXTRASAMPLES: Final = 338
SAMPLEFORMAT: Final = 339
JPEGTABLES: Final = 347
YCBCRSUBSAMPLING: Final = 530
REFERENCEBLACKWHITE: Final = 532
COPYRIGHT: Final = 33432
IPTC_NAA_CHUNK: Final = 33723
PHOTOSHOP_CHUNK: Final = 34377
ICCPROFILE: Final = 34675
EXIFIFD: Final = 34665
XMP: Final = 700
JPEGQUALITY: Final = 65537
IMAGEJ_META_DATA_BYTE_COUNTS: Final = 50838
IMAGEJ_META_DATA: Final = 50839
COMPRESSION_INFO: Final[dict[int, str]]
COMPRESSION_INFO_REV: Final[dict[str, int]]
OPEN_INFO: Final[dict[_OpenInfo, tuple[str, str]]]
MAX_SAMPLESPERPIXEL: Final = 6
PREFIXES: Final[list[bytes]]
class IFDRational(Rational):
def __init__(self, value, denominator: int = 1) -> None: ...
@property
def numerator(a): ...
@property
def denominator(a): ...
def limit_rational(self, max_denominator): ...
def __hash__(self) -> int: ...
def __eq__(self, other): ...
# The following methods are aliased from fractions.Fraction:
@overload
def __add__(a, b: int | Fraction) -> Fraction: ...
@overload
def __add__(a, b: float) -> float: ...
@overload
def __add__(a, b: complex) -> complex: ...
@overload
def __radd__(b, a: int | Fraction) -> Fraction: ...
@overload
def __radd__(b, a: float) -> float: ...
@overload
def __radd__(b, a: complex) -> complex: ...
@overload
def __sub__(a, b: int | Fraction) -> Fraction: ...
@overload
def __sub__(a, b: float) -> float: ...
@overload
def __sub__(a, b: complex) -> complex: ...
@overload
def __rsub__(b, a: int | Fraction) -> Fraction: ...
@overload
def __rsub__(b, a: float) -> float: ...
@overload
def __rsub__(b, a: complex) -> complex: ...
@overload
def __mul__(a, b: int | Fraction) -> Fraction: ...
@overload
def __mul__(a, b: float) -> float: ...
@overload
def __mul__(a, b: complex) -> complex: ...
@overload
def __rmul__(b, a: int | Fraction) -> Fraction: ...
@overload
def __rmul__(b, a: float) -> float: ...
@overload
def __rmul__(b, a: complex) -> complex: ...
@overload
def __truediv__(a, b: int | Fraction) -> Fraction: ...
@overload
def __truediv__(a, b: float) -> float: ...
@overload
def __truediv__(a, b: complex) -> complex: ...
@overload
def __rtruediv__(b, a: int | Fraction) -> Fraction: ...
@overload
def __rtruediv__(b, a: float) -> float: ...
@overload
def __rtruediv__(b, a: complex) -> complex: ...
@overload
def __floordiv__(a, b: int | Fraction) -> int: ...
@overload
def __floordiv__(a, b: float) -> float: ...
@overload
def __rfloordiv__(b, a: int | Fraction) -> int: ...
@overload
def __rfloordiv__(b, a: float) -> float: ...
@overload
def __mod__(a, b: int | Fraction) -> Fraction: ...
@overload
def __mod__(a, b: float) -> float: ...
@overload
def __rmod__(b, a: int | Fraction) -> Fraction: ...
@overload
def __rmod__(b, a: float) -> float: ...
@overload
def __pow__(a, b: int) -> Fraction: ...
@overload
def __pow__(a, b: float | Fraction) -> float: ...
@overload
def __pow__(a, b: complex) -> complex: ...
@overload
def __rpow__(b, a: float | Fraction) -> float: ...
@overload
def __rpow__(b, a: complex) -> complex: ...
def __pos__(a) -> Fraction: ...
def __neg__(a) -> Fraction: ...
def __abs__(a) -> Fraction: ...
def __trunc__(a) -> int: ...
def __lt__(a, b: _ComparableNum) -> bool: ...
def __gt__(a, b: _ComparableNum) -> bool: ...
def __le__(a, b: _ComparableNum) -> bool: ...
def __ge__(a, b: _ComparableNum) -> bool: ...
def __bool__(a) -> bool: ...
def __ceil__(a) -> int: ...
def __floor__(a) -> int: ...
@overload
def __round__(self, ndigits: None = None) -> int: ...
@overload
def __round__(self, ndigits: int) -> Fraction: ...
if sys.version_info >= (3, 11):
def __int__(a, _index: Callable[[SupportsIndex], int] = ...) -> int: ...
class ImageFileDirectory_v2(MutableMapping[int, Incomplete]):
group: int | None
tagtype: dict[int, int]
def __init__(
self, ifh: bytes = b"II*\x00\x00\x00\x00\x00", prefix: bytes | None = None, group: int | None = None
) -> None: ...
@property
def prefix(self) -> bytes: ...
@property
def offset(self) -> int | None: ...
@property
def legacy_api(self) -> bool: ...
def reset(self) -> None: ...
def named(self): ...
def __len__(self) -> int: ...
def __getitem__(self, tag): ...
def __contains__(self, tag): ...
def __setitem__(self, tag, value) -> None: ...
def __delitem__(self, tag) -> None: ...
def __iter__(self): ...
def load_byte(self, data, legacy_api: bool = True): ...
def write_byte(self, data): ...
def load_string(self, data, legacy_api: bool = True): ...
def write_string(self, value: int | str | bytes) -> bytes: ...
def load_rational(self, data, legacy_api: bool = True): ...
def write_rational(self, *values): ...
def load_undefined(self, data, legacy_api: bool = True): ...
def write_undefined(self, value): ...
def load_signed_rational(self, data, legacy_api: bool = True): ...
def write_signed_rational(self, *values): ...
def load(self, fp) -> None: ...
def tobytes(self, offset: int = 0): ...
def save(self, fp): ...
load_double: Incomplete
load_float: Incomplete
load_long: Incomplete
load_long8: Incomplete
load_short: Incomplete
load_signed_byte: Incomplete
load_signed_long: Incomplete
load_signed_short: Incomplete
write_double: Incomplete
write_float: Incomplete
write_long: Incomplete
write_long8: Incomplete
write_short: Incomplete
write_signed_byte: Incomplete
write_signed_long: Incomplete
write_signed_short: Incomplete
class ImageFileDirectory_v1(ImageFileDirectory_v2):
def __init__(self, *args, **kwargs) -> None: ...
@property
def tags(self): ...
@property
def tagdata(self): ...
tagtype: dict[int, int]
@classmethod
def from_v2(cls, original): ...
def to_v2(self): ...
def __contains__(self, tag): ...
def __len__(self) -> int: ...
def __iter__(self): ...
def __setitem__(self, tag, value) -> None: ...
def __getitem__(self, tag): ...
ImageFileDirectory = ImageFileDirectory_v1
class TiffImageFile(ImageFile):
format: ClassVar[Literal["TIFF", "MIC"]]
format_description: ClassVar[str]
tag_v2: Incomplete
tag: Incomplete
def __init__(self, fp: Incomplete | None = None, filename: Incomplete | None = None) -> None: ...
@property
def n_frames(self): ...
im: Incomplete
def seek(self, frame) -> None: ...
def tell(self): ...
def getxmp(self): ...
def get_photoshop_blocks(self): ...
def load(self) -> _PixelAccessor: ...
def load_end(self) -> None: ...
SAVE_INFO: Incomplete
class AppendingTiffWriter:
fieldSizes: Incomplete
Tags: Incomplete
f: Incomplete
close_fp: bool
name: Incomplete
beginning: Incomplete
def __init__(self, fn, new: bool = False) -> None: ...
whereToWriteNewIFDOffset: Incomplete
offsetOfNewPage: int
IIMM: Incomplete
isFirst: bool
def setup(self) -> None: ...
def finalize(self) -> None: ...
def newFrame(self) -> None: ...
def __enter__(self): ...
def __exit__(
self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None
) -> Literal[False]: ...
def tell(self): ...
def seek(self, offset, whence=0): ...
def goToEnd(self) -> None: ...
endian: Incomplete
longFmt: Incomplete
shortFmt: Incomplete
tagFormat: Incomplete
def setEndian(self, endian) -> None: ...
def skipIFDs(self) -> None: ...
def write(self, data): ...
def readShort(self): ...
def readLong(self): ...
def rewriteLastShortToLong(self, value) -> None: ...
def rewriteLastShort(self, value) -> None: ...
def rewriteLastLong(self, value) -> None: ...
def writeShort(self, value) -> None: ...
def writeLong(self, value) -> None: ...
def close(self) -> None: ...
def fixIFD(self) -> None: ...
def fixOffsets(self, count, isShort: bool = False, isLong: bool = False) -> None: ...

View File

@@ -1,46 +0,0 @@
from _typeshed import Incomplete
from typing import Final, Literal, NamedTuple
from typing_extensions import TypeAlias
_TagType: TypeAlias = Literal[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16]
_TagTuple: TypeAlias = tuple[str, _TagType, int] | tuple[str, _TagInfo, int, dict[str, int]]
class _TagInfo(NamedTuple):
value: Incomplete
name: str
type: _TagType
length: int
enum: dict[str, int]
class TagInfo(_TagInfo):
def __new__(
cls,
value: Incomplete | None = None,
name: str = "unknown",
type: _TagType | None = None,
length: int | None = None,
enum: dict[str, int] | None = None,
): ...
def cvt_enum(self, value): ...
def lookup(tag: int, group: int | None = None) -> _TagInfo: ...
BYTE: Final = 1
ASCII: Final = 2
SHORT: Final = 3
LONG: Final = 4
RATIONAL: Final = 5
SIGNED_BYTE: Final = 6
UNDEFINED: Final = 7
SIGNED_SHORT: Final = 8
SIGNED_LONG: Final = 9
SIGNED_RATIONAL: Final = 10
FLOAT: Final = 11
DOUBLE: Final = 12
IFD: Final = 13
LONG8: Final = 16
TAGS_V2: dict[int, _TagTuple]
TAGS_V2_GROUPS: dict[int, dict[int, _TagTuple]]
TAGS: dict[int, str]
TYPES: dict[int, str]
LIBTIFF_CORE: set[int]

View File

@@ -1,14 +0,0 @@
from _typeshed import StrOrBytesPath
from typing import ClassVar, Literal
from . import ImageFile
from ._imaging import _PixelAccessor
class WalImageFile(ImageFile.ImageFile):
format: ClassVar[Literal["WAL"]]
format_description: ClassVar[str]
def load(self) -> _PixelAccessor: ...
def open(filename: StrOrBytesPath) -> WalImageFile: ...
quake2palette: bytes

View File

@@ -1,18 +0,0 @@
from typing import ClassVar, Literal
from typing_extensions import TypeAlias
from ._imaging import _PixelAccessor
from .ImageFile import ImageFile
SUPPORTED: bool
_XMP_Tags: TypeAlias = dict[str, str | _XMP_Tags]
class WebPImageFile(ImageFile):
format: ClassVar[Literal["WEBP"]]
format_description: ClassVar[str]
def getxmp(self) -> _XMP_Tags: ...
def seek(self, frame: int) -> None: ...
def load(self) -> _PixelAccessor: ...
def load_seek(self, pos: int) -> None: ...
def tell(self) -> int: ...

View File

@@ -1,19 +0,0 @@
import sys
from _typeshed import Incomplete
from typing import ClassVar, Literal
from ._imaging import _PixelAccessor
from .ImageFile import StubImageFile
def register_handler(handler) -> None: ...
if sys.platform == "win32":
class WmfHandler:
bbox: Incomplete
def open(self, im) -> None: ...
def load(self, im): ...
class WmfStubImageFile(StubImageFile):
format: ClassVar[Literal["WMF"]]
format_description: ClassVar[str]
def load(self, dpi: Incomplete | None = None) -> _PixelAccessor: ...

View File

@@ -1,9 +0,0 @@
from typing import ClassVar, Literal
from .ImageFile import ImageFile
PALETTE: bytes
class XVThumbImageFile(ImageFile):
format: ClassVar[Literal["XVThumb"]]
format_description: ClassVar[str]

View File

@@ -1,10 +0,0 @@
from _typeshed import Incomplete
from typing import ClassVar, Literal
from .ImageFile import ImageFile
xbm_head: Incomplete
class XbmImageFile(ImageFile):
format: ClassVar[Literal["XBM"]]
format_description: ClassVar[str]

View File

@@ -1,11 +0,0 @@
from _typeshed import Incomplete
from typing import ClassVar, Literal
from .ImageFile import ImageFile
xpm_head: Incomplete
class XpmImageFile(ImageFile):
format: ClassVar[Literal["XPM"]]
format_description: ClassVar[str]
def load_read(self, bytes): ...

View File

@@ -1,3 +0,0 @@
__version__: str
class UnidentifiedImageError(OSError): ...

View File

@@ -1,13 +0,0 @@
def i8(c: bytes) -> int: ...
def o8(i: int) -> bytes: ...
def i16le(c: bytes, o: int = 0) -> int: ...
def si16le(c: bytes, o: int = 0) -> int: ...
def si16be(c: bytes, o: int = 0) -> int: ...
def i32le(c: bytes, o: int = 0) -> int: ...
def si32le(c: bytes, o: int = 0) -> int: ...
def i16be(c: bytes, o: int = 0) -> int: ...
def i32be(c: bytes, o: int = 0) -> int: ...
def o16le(i: int) -> bytes: ...
def o32le(i: int) -> bytes: ...
def o16be(i: int) -> bytes: ...
def o32be(i: int) -> bytes: ...

View File

@@ -1,29 +0,0 @@
from _typeshed import Incomplete
from collections.abc import Sequence
from typing import Literal, Protocol
DEFAULT_STRATEGY: Literal[0]
FILTERED: Literal[1]
HUFFMAN_ONLY: Literal[2]
RLE: Literal[3]
FIXED: Literal[4]
class _PixelAccessor(Protocol): # noqa: Y046
# PIL has two concrete types for accessing an image's pixels by coordinate lookup:
# PixelAccess (written in C; not runtime-importable) and PyAccess (written in
# Python + cffi; is runtime-importable). PixelAccess came first. PyAccess was added
# in later to support PyPy, but otherwise is intended to expose the same interface
# PixelAccess.
#
# This protocol describes that interface.
# TODO: should the color args and getter return types be _Color?
def __setitem__(self, xy: tuple[int, int], color, /) -> None: ...
def __getitem__(self, xy: tuple[int, int], /): ...
def putpixel(self, xy: tuple[int, int], color, /) -> None: ...
def getpixel(self, xy: tuple[int, int], /): ...
class _Path:
def __getattr__(self, item: str) -> Incomplete: ...
def path(x: Sequence[tuple[float, float]] | Sequence[float], /) -> _Path: ...
def __getattr__(name: str, /) -> Incomplete: ...

View File

@@ -1,2 +0,0 @@
TKINTER_LIB: str
tk_version: str

View File

@@ -1 +0,0 @@
__version__: str

View File

@@ -1,23 +0,0 @@
from _typeshed import Incomplete
modules: Incomplete
def check_module(feature): ...
def version_module(feature): ...
def get_supported_modules(): ...
codecs: Incomplete
def check_codec(feature): ...
def version_codec(feature): ...
def get_supported_codecs(): ...
features: Incomplete
def check_feature(feature): ...
def version_feature(feature): ...
def get_supported_features(): ...
def check(feature): ...
def version(feature): ...
def get_supported(): ...
def pilinfo(out: Incomplete | None = None, supported_formats: bool = True) -> None: ...

View File

@@ -1,6 +1,7 @@
version = "8.0.*"
upstream_repository = "https://github.com/lincolnloop/python-qrcode"
requires = ["types-Pillow>=9.1.0"]
# must be a version of Pillow that is py.typed
requires = ["Pillow>=10.3.0"]
[tool.stubtest]
extras = ["pil"]

View File

@@ -162,7 +162,7 @@ it checks all third-party stubs, but you can provide the distributions to
check on the command line:
```bash
(.venv3)$ python3 tests/stubtest_third_party.py Pillow toml # check stubs/Pillow and stubs/toml
(.venv3)$ python3 tests/stubtest_third_party.py requests toml # check stubs/requests and stubs/toml
```
If you have the runtime package installed in your local virtual environment, you can also run stubtest