Importing The Required Libraries111
Importing The Required Libraries111
import tkinter as tk
from tkinter import filedialog
from tkinter import messagebox
from PIL import Image, ImageTk, ImageSequence
# Setting title
root.title("ProjectGurukul - GIF Creator")
def update_frame(frame_idx=0):
frame = frames[frame_idx].resize((300, 300), Image.ANTIALIAS)
frame_photo = ImageTk.PhotoImage(frame)
gif_label.config(image=frame_photo)
gif_label.image = frame_photo # Keep a reference to avoid garbage collection
update_frame()
# Save as GIF
images[0].save(output_file_name, save_all=True, append_images=images[1:], loop=0, duration=500)
input_label = tk.Label(root)
input_label.configure(background="#D7BDE2", foreground="#333333", font="Arial 14", justify="center",
text="Input Files: ")
input_label.place(x=20, y=70, width=328, height=40)
input_button = tk.Button(root)
input_button.configure(font="Arial 14", justify="center", text="Choose Images", command=input_file)
input_button.place(x=380, y=70, width=160, height=40)
output_label = tk.Label(root)
output_label.configure(background="#D7BDE2", foreground="#333333", font="Arial 14",
justify="center", text="Save As: ")
output_label.place(x=20, y=150, width=328, height=40)
output_button = tk.Button(root)
output_button.configure(font="Arial 14", justify="center", text="Choose Path", command=output_file)
output_button.place(x=380, y=150, width=160, height=40)
create_button = tk.Button(root)
create_button.configure(font="Arial 20 bold", justify="center", text="Create GIF", command=create_gif)
create_button.place(x=200, y=230, width=205, height=52)