lesliemwubbel

Glitch_this_test2_gif.py

Nov 24th, 2020 (edited)
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.83 KB | None | 0 0
  1. from PIL import Image
  2. from glitch_this import ImageGlitcher
  3.  
  4. img = Image.open(r'D:\Glitch_art\VczjpwS.gif')
  5. glitcher = ImageGlitcher()
  6. glitch_img, src_gif_duration, src_gif_frames = glitcher.glitch_gif(img, 4, color_offset=True)
  7.  
  8. DURATION = 200      # Set this to however many centiseconds each frame should be visible for
  9. LOOP = 0            # Set this to how many times the gif should loop
  10.                     # LOOP = 0 means infinite loop
  11.  
  12. # You could also use the `src_gif_duration` returned by `glitch_gif`
  13. # To keep the GIF exactly the same duration wise
  14.  
  15. glitch_img[0].save(r'D:\Glitch_art\Glitch_programming\output\outputglitched_test2.gif',
  16.                    format='GIF',
  17.                    append_images=glitch_img[1:],
  18.                    save_all=True,
  19.                    duration=DURATION,
  20.                    loop=LOOP)
Add Comment
Please, Sign In to add comment