import random import os from PIL import Image import base64 from io import BytesIO import os def generate_layers(images, index=0): if len(images) == 0: return '' return f''' {generate_layers(images[1:], index+1)} ''' def generate_captcha_html(images): html = '' html_prelude = '''