Skip to content

Commit

Permalink
add step_on
Browse files Browse the repository at this point in the history
  • Loading branch information
MeetWq committed Mar 28, 2023
1 parent 0343175 commit 28ef724
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions meme_generator/memes/step_on/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
from pathlib import Path
from typing import List

from PIL.Image import Image as IMG
from pil_utils import BuildImage

from meme_generator import add_meme
from meme_generator.utils import save_gif

img_dir = Path(__file__).parent / "images"


def step_on(images: List[BuildImage], texts, args):
img = images[0].convert("RGBA").resize((100, 100), keep_ratio=True)
frames: List[IMG] = []
locs = [
(104, 72, 32, 185, -25),
(104, 72, 32, 185, -25),
(90, 73, 51, 207, 0),
(88, 78, 51, 202, 0),
(88, 86, 49, 197, 0),
]
for i in range(5):
frame = BuildImage.open(img_dir / f"{i}.png")
w, h, x, y, angle = locs[i]
frame.paste(img.resize((w, h)).rotate(angle, expand=True), (x, y), below=True)
frames.append(frame.image)
return save_gif(frames, 0.07)


add_meme("step_on", step_on, min_images=1, max_images=1, keywords=["踩"])
Binary file added meme_generator/memes/step_on/images/0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added meme_generator/memes/step_on/images/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added meme_generator/memes/step_on/images/2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added meme_generator/memes/step_on/images/3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added meme_generator/memes/step_on/images/4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 28ef724

Please sign in to comment.