반응형
- 코드 작성
from PIL import Image
gif_image = Image.open('example.gif')
for frame_num in range(gif_image.n_frames):
gif_image.seek(frame_num)
jpeg_image = gif_image.convert('RGB')
jpeg_image.save(f'example_{frame_num:03d}.jpg')
- 단일 변환
from PIL import Image
gif_image = Image.open('example.gif')
jpeg_image = gif_image.convert('RGB')
jpeg_image.save('example.jpg')
반응형