@@ -55,10 +55,8 @@ def pad_image(img: Image.Image, pad_width: int, pad_height: int) -> Image.Image:
55
55
if pad_width == ori_width and pad_height == ori_height :
56
56
return img
57
57
58
- pad_img = Image .new (img .mode , (pad_width , pad_height ))
59
- pad_img .paste (img )
60
-
61
58
# Paste the original image at the top-left corner
59
+ pad_img = Image .new (img .mode , (pad_width , pad_height ))
62
60
pad_img .paste (img , (0 , 0 ))
63
61
64
62
# Fill the right border: duplicate the last column
@@ -259,15 +257,6 @@ def image_to_texture2d(
259
257
return enc_img , tex_format
260
258
261
259
262
- def assert_rgba (img : Image .Image , target_texture_format : TextureFormat ) -> Image .Image :
263
- if img .mode == "RGB" :
264
- img = img .convert ("RGBA" )
265
- assert img .mode == "RGBA" , (
266
- f"{ target_texture_format } compression only supports RGB & RGBA images"
267
- ) # noqa: E501
268
- return img
269
-
270
-
271
260
def get_image_from_texture2d (
272
261
texture_2d : Texture2D ,
273
262
flip : bool = True ,
@@ -341,8 +330,7 @@ def parse_image_data(
341
330
if not selection :
342
331
raise NotImplementedError (f"Not implemented texture format: { texture_format } " )
343
332
344
- if not isinstance (image_data , bytes ):
345
- image_data = bytes (image_data )
333
+ image_data = bytes (image_data )
346
334
347
335
if "Crunched" in texture_format .name :
348
336
if (
0 commit comments