#!/usr/bin/env python3 """ Generate period-accurate decorative GIFs for 90s retro websites. Creates pixel art icons, bullet points, animated badges, etc. """ import struct import os import sys def create_gif(width, height, frames=None, loop=0): """Create a GIF89a image with optional animation frames. frames: list of [[(r,g,b), ...], ...] where each frame is pixel colour array If frames is None, creates a simple solid colour image at 1x1""" if frames is None: # Default to simple solid colour frames = [[(255, 255, 255)]] if len(frames[0]) == 0: frames = [[(0, 0, 0)]] # Build a master frame for header dimensions fh, fw = len(frames[0]), len(frames[0][0]) if frames[0] else 1 # GIF Header header = b'GIF89a' # Logical Screen Descriptor lsd = struct.pack(' 1 else './retro-images' os.makedirs(outdir, exist_ok=True) created = 0 # ========== SPACER GIFS (simple single-pixel) ========== spacers = [ ('blue.gif', 0, 0, 200), ('navy.gif', 0, 0, 128), ('white.gif', 255, 255, 255), ('grey.gif', 192, 192, 192), ('light_grey.gif', 220, 220, 220), ('dark_grey.gif', 100, 100, 100), ('red.gif', 200, 0, 0), ('yellow.gif', 255, 255, 0), ('green.gif', 0, 255, 0), ('orange.gif', 255, 165, 0), ('cyan.gif', 0, 255, 255), ('magenta.gif', 255, 0, 255), ('gold.gif', 255, 215, 0), ('transparent.gif', 0, 0, 0), # special handling ] for fname, r, g, b in spacers: if fname == 'transparent.gif': # Transparent 1x1 GIF gif = bytearray(b'GIF89a') gif += struct.pack('