Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added script to generate a spinning gif of the logo #4

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.gif
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please namespace this, otherwise we can never submit a gif source file to this repo.

Binary file added centered-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions fspinner.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
from PIL import Image, ImageOps
from sys import argv

reverse = lambda a: [a[-1]] + reverse(a[:-1]) if len(a) > 0 else []

image = Image.open("centered-logo.png" if not len(argv) > 1 else argv[1]).resize((512, 512))
final = Image.new("RGBA", image.size, "WHITE")
final.paste(image, (0, 0), image)

final_inverted = ImageOps.invert(final.convert("RGB"))


frames = [final.rotate((i*24)/3) for i in range(15)]
reverse_frames = reverse(frames)
# shitty hack
fix = [Image.new("RGBA", frame.size, "WHITE") for frame in reverse_frames]
for fixed_frame, frame in zip(fix, reverse_frames):
fixed_frame.paste(frame, (0, 0), frame)
# end shitty hack

inverted_frames = [final_inverted.rotate((i*24)/3) for i in range(15)]

reverse_inverted_frames = reverse(inverted_frames)

frames[0].save("fspinner.gif", save_all=True, append_images=frames[1:], optimize=True, loop=0, duration=60)
fix[0].save("fspinner-reverse.gif", save_all=True, append_images=fix[1:], optimize=True, loop=0, duration=60)
inverted_frames[0].save("inverted-fspinner.gif", save_all=True, append_images=inverted_frames[1:], optimize=True, loop=0, duration=60)
reverse_inverted_frames[0].save("inverted-reversed-fspinner.gif", save_all=True, append_images=reverse_inverted_frames[1:], optimize=True, loop=0, duration=60)

# create the speedyboi
speedyboi = [final.rotate(360-(i*24)) for i in range(int(15/3))]
speedyboi[0].save("speedyboi.gif", save_all=True, append_images=speedyboi[1:], loop=0, optimize=True, duration=25)
Binary file added logo_centered.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.