Skip to content

Commit f594d20

Browse files
committed
Removed unneeded converts
1 parent 2f16077 commit f594d20

1 file changed

Lines changed: 0 additions & 3 deletions

File tree

src/PIL/VtfImagePlugin.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ def _write_image(fp: IO[bytes], im: Image.Image, pixel_format: VtfPF) -> None:
163163
encoder_args: tuple[int,] | tuple[str, int, int]
164164
if pixel_format == VtfPF.DXT1:
165165
encoder_args = (1,)
166-
im = im.convert("RGBA")
167166
elif pixel_format == VtfPF.DXT3:
168167
encoder_args = (3,)
169168
elif pixel_format == VtfPF.DXT5:
@@ -178,10 +177,8 @@ def _write_image(fp: IO[bytes], im: Image.Image, pixel_format: VtfPF) -> None:
178177
encoder_args = ("A", 0, 0)
179178
elif pixel_format == VtfPF.I8:
180179
encoder_args = ("L", 0, 0)
181-
im = im.convert("L")
182180
elif pixel_format == VtfPF.IA88:
183181
encoder_args = ("LA", 0, 0)
184-
im = im.convert("LA")
185182
elif pixel_format == VtfPF.UV88:
186183
encoder_args = ("RG", 0, 0)
187184
else:

0 commit comments

Comments
 (0)