Pastebin
Retrouvez, créez et partagez vos snippets en temps réel.
Rechercher un Pastebin
Aucun paste trouvé.
Créer un paste
Pastebin
Blog
GIF
from PIL import Image, ImageEnhance import numpy as np # Load the provided logo image img = Image.open('/mnt/data/Gemini_Generated_Image_mukfjimukfjimukf.png').convert("RGBA") # Create square canvas size = max(img.size) canvas_size = (size, size) frames = [] n_frames = 36 for i in range(n_frames): t = i / n_frames # Smooth professional easing ease = 0.5 - 0.5 * np.cos(2 * np.pi * t) # Subtle scale pulse scale = 0.96 + 0.04 * ease # Gentle horizontal reveal drift dx = int(4 * np.sin(2 * np.pi * t)) # Soft brightness modulation bright = ImageEnhance.Brightness(img).enhance(1.0 + 0.06 * ease) # Resize new_size = (int(bright.width * scale), int(bright.height * scale)) resized = bright.resize(new_size, Image.LANCZOS) # Compose frame frame = Image.new("RGBA", canvas_size, (255, 255, 255, 0)) frame.paste( resized, ((size - new_size[0]) // 2 + dx, (size - new_size[1]) // 2), resized ) frames.append(frame) # Save looping GIF gif_path = "/mnt/data/save_project_professional_dynamic.gif" frames[0].save( gif_path, save_all=True, append_images=frames[1:], duration=65, loop=0, disposal=2, transparency=0 ) gif_path
Créé il y a 1 mois.