Skip to content

Commit 67f95db

Browse files
authored
Rename typing.Image type aliases to PixelArray to avoid conflict with PIL.Image (#3851)
1 parent bf2feee commit 67f95db

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

manim/mobject/mobject.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@
4444

4545
from manim.typing import (
4646
FunctionOverride,
47-
Image,
4847
ManimFloat,
4948
ManimInt,
5049
MappingFunction,
5150
PathFuncType,
51+
PixelArray,
5252
Point3D,
5353
Point3D_Array,
5454
Vector3D,
@@ -825,7 +825,7 @@ def apply_over_attr_arrays(self, func: MappingFunction) -> Self:
825825

826826
# Displaying
827827

828-
def get_image(self, camera=None) -> Image:
828+
def get_image(self, camera=None) -> PixelArray:
829829
if camera is None:
830830
from ..camera.camera import Camera
831831

manim/typing.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@
7777
"FunctionOverride",
7878
"PathFuncType",
7979
"MappingFunction",
80-
"Image",
81-
"GrayscaleImage",
82-
"RGBImage",
83-
"RGBAImage",
80+
"PixelArray",
81+
"GrayscalePixelArray",
82+
"RGBPixelArray",
83+
"RGBAPixelArray",
8484
"StrPath",
8585
"StrOrBytesPath",
8686
]
@@ -582,7 +582,7 @@
582582
Image types
583583
"""
584584

585-
Image: TypeAlias = npt.NDArray[ManimInt]
585+
PixelArray: TypeAlias = npt.NDArray[ManimInt]
586586
"""``shape: (height, width) | (height, width, 3) | (height, width, 4)``
587587
588588
A rasterized image with a height of ``height`` pixels and a width of
@@ -595,24 +595,24 @@
595595
`RGBA_Array_Int`.
596596
"""
597597

598-
GrayscaleImage: TypeAlias = Image
598+
GrayscalePixelArray: TypeAlias = PixelArray
599599
"""``shape: (height, width)``
600600
601-
A 100% opaque grayscale `Image`, where every pixel value is a
601+
A 100% opaque grayscale `PixelArray`, where every pixel value is a
602602
`ManimInt` indicating its lightness (black -> gray -> white).
603603
"""
604604

605-
RGBImage: TypeAlias = Image
605+
RGBPixelArray: TypeAlias = PixelArray
606606
"""``shape: (height, width, 3)``
607607
608-
A 100% opaque `Image` in color, where every pixel value is an
608+
A 100% opaque `PixelArray` in color, where every pixel value is an
609609
`RGB_Array_Int` object.
610610
"""
611611

612-
RGBAImage: TypeAlias = Image
612+
RGBAPixelArray: TypeAlias = PixelArray
613613
"""``shape: (height, width, 4)``
614614
615-
An `Image` in color where pixels can be transparent. Every pixel
615+
A `PixelArray` in color where pixels can be transparent. Every pixel
616616
value is an `RGBA_Array_Int` object.
617617
"""
618618

0 commit comments

Comments
 (0)