Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from PIL import Image
- from glitch_this import ImageGlitcher
- img = Image.open(r'D:\Glitch_art\VczjpwS.gif')
- glitcher = ImageGlitcher()
- glitch_img, src_gif_duration, src_gif_frames = glitcher.glitch_gif(img, 4, color_offset=True)
- DURATION = 200 # Set this to however many centiseconds each frame should be visible for
- LOOP = 0 # Set this to how many times the gif should loop
- # LOOP = 0 means infinite loop
- # You could also use the `src_gif_duration` returned by `glitch_gif`
- # To keep the GIF exactly the same duration wise
- glitch_img[0].save(r'D:\Glitch_art\Glitch_programming\output\outputglitched_test2.gif',
- format='GIF',
- append_images=glitch_img[1:],
- save_all=True,
- duration=DURATION,
- loop=LOOP)
Add Comment
Please, Sign In to add comment