Hidden-Hyperparameter / PVZ-2024

pvz-2024
1 stars 1 forks source link

[New Feature]More plants and zombies #3

Open Hidden-Hyperparameter opened 7 months ago

Hidden-Hyperparameter commented 7 months ago

You can develop this project by adding more units. The basic way is written in README.md, and the required audio or image informations are in the folder external_image_and_audio.

Hidden-Hyperparameter commented 7 months ago

Thank @liuhanzuo for gathering these materials. On how to separate a .gif file into .png, you should ask GPT or follow the python code:

from PIL import Image
from PIL.GifImagePlugin import ImageSequence
import os

def convert_gif_to_png_frames(gif_path, png_folder='frames'):
    gif = Image.open(gif_path)
    i = 0
    for frame in ImageSequence.Iterator(gif):
        frame.save(os.path.join(png_folder, f'{i}.png'), 'PNG')
        i += 1
convert_gif_to_png_frames('path_to_your_gif.gif')