99TF = TextureFormat
1010
1111
12- def image_to_texture2d (img : Image , target_texture_format : TF , flip : bool = True ):
12+ def image_to_texture2d (img : Image . Image , target_texture_format : TF , flip : bool = True ):
1313 if flip :
1414 img = img .transpose (Image .FLIP_TOP_BOTTOM )
1515
@@ -76,7 +76,7 @@ def image_to_texture2d(img: Image, target_texture_format: TF, flip: bool = True)
7676 return enc_img , tex_format
7777
7878
79- def get_image_from_texture2d (texture_2d , flip = True ) -> Image :
79+ def get_image_from_texture2d (texture_2d , flip = True ) -> Image . Image :
8080 """converts the given texture into PIL.Image
8181
8282 :param texture_2d: texture to be converterd
@@ -153,7 +153,7 @@ def pillow(
153153 codec : str ,
154154 args ,
155155 swap : tuple = None ,
156- ) -> Image :
156+ ) -> Image . Image :
157157 img = (
158158 Image .frombytes (mode , (width , height ), image_data , codec , args )
159159 if width
@@ -165,7 +165,7 @@ def pillow(
165165 return img
166166
167167
168- def atc (image_data : bytes , width : int , height : int , alpha : bool ) -> Image :
168+ def atc (image_data : bytes , width : int , height : int , alpha : bool ) -> Image . Image :
169169 if alpha :
170170 image_data = texture2ddecoder .decode_atc_rgba8 (image_data , width , height )
171171 else :
@@ -174,7 +174,7 @@ def atc(image_data: bytes, width: int, height: int, alpha: bool) -> Image:
174174 return Image .frombytes ("RGBA" , (width , height ), image_data , "raw" , "BGRA" )
175175
176176
177- def astc (image_data : bytes , width : int , height : int , block_size : tuple ) -> Image :
177+ def astc (image_data : bytes , width : int , height : int , block_size : tuple ) -> Image . Image :
178178 image_data = texture2ddecoder .decode_astc (image_data , width , height , * block_size )
179179 return Image .frombytes ("RGBA" , (width , height ), image_data , "raw" , "BGRA" )
180180
@@ -219,7 +219,7 @@ def half(
219219 codec : str ,
220220 args ,
221221 swap : tuple = None ,
222- ) -> Image :
222+ ) -> Image . Image :
223223 # convert half-float to int8
224224 stream = BytesIO (image_data )
225225 image_data = bytes (
0 commit comments