forked from PSLmodels/OG-Core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6eadf82
commit 331da12
Showing
13 changed files
with
1,396 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
__author__ = 'Evan Magnusson' | ||
from images2gif import writeGif | ||
from PIL import Image | ||
import os | ||
|
||
file_names = sorted((fn for fn in os.listdir('.') if fn.endswith('.png'))) | ||
#['animationframa.png', 'animationframb.png', 'animationframc.png', ...] " | ||
|
||
images = [Image.open(fn) for fn in file_names] | ||
|
||
print writeGif.__doc__ | ||
# writeGif(filename, images, duration=0.1, loops=0, dither=1) | ||
# Write an animated gif from the specified images. | ||
# images should be a list of numpy arrays of PIL images. | ||
# Numpy images of type float should have pixels between 0 and 1. | ||
# Numpy images of other types are expected to have values between 0 and 255. | ||
|
||
|
||
#images.extend(reversed(images)) #infinit loop will go backwards and forwards. | ||
|
||
filename = "savings_dif_gif.GIF" | ||
writeGif(filename, images, duration=0.2) | ||
#54 frames written | ||
# | ||
#Process finished with exit code 0 |
Oops, something went wrong.