diff --git a/memes/lash/__init__.py b/memes/lash/__init__.py new file mode 100644 index 0000000..d665ae6 --- /dev/null +++ b/memes/lash/__init__.py @@ -0,0 +1,33 @@ +from pathlib import Path + +from meme_generator import add_meme +from meme_generator.utils import save_gif +from PIL.Image import Image as IMG +from pil_utils import BuildImage + +img_dir = Path(__file__).parent / "images" + + +def lash(images: list[BuildImage], texts, args): + self_head = images[0].convert("RGBA").circle().resize((22, 22)) + user_head = images[1].convert("RGBA").circle().resize((22, 22)) + # fmt: off + self_locs = [ + (84,25), (87,23), (87,27), (86,28), (62,26), + (59,28), (76,20), (85,24), (80,23), + ] + user_locs = [ + (12,69), (15,66), (14,67), (15,66), (17,67), + (14,63), (21,56), (15,62), (17,69) + ] + # fmt: on + frames: list[IMG] = [] + for i in range(9): + frame = BuildImage.open(img_dir / f"{i}.png") + frame.paste(self_head, self_locs[i], alpha=True) + frame.paste(user_head, user_locs[i], alpha=True) + frames.append(frame.image) + return save_gif(frames, 0.05) + + +add_meme("lash", lash, min_images=2, max_images=2, keywords=["鞭笞", "鞭打", "鞭挞", "鞭策"]) diff --git a/memes/lash/images/0.png b/memes/lash/images/0.png new file mode 100644 index 0000000..0e62b31 Binary files /dev/null and b/memes/lash/images/0.png differ diff --git a/memes/lash/images/1.png b/memes/lash/images/1.png new file mode 100644 index 0000000..c2eacd4 Binary files /dev/null and b/memes/lash/images/1.png differ diff --git a/memes/lash/images/2.png b/memes/lash/images/2.png new file mode 100644 index 0000000..4c68687 Binary files /dev/null and b/memes/lash/images/2.png differ diff --git a/memes/lash/images/3.png b/memes/lash/images/3.png new file mode 100644 index 0000000..0892c25 Binary files /dev/null and b/memes/lash/images/3.png differ diff --git a/memes/lash/images/4.png b/memes/lash/images/4.png new file mode 100644 index 0000000..95aa8f2 Binary files /dev/null and b/memes/lash/images/4.png differ diff --git a/memes/lash/images/5.png b/memes/lash/images/5.png new file mode 100644 index 0000000..23bbfb4 Binary files /dev/null and b/memes/lash/images/5.png differ diff --git a/memes/lash/images/6.png b/memes/lash/images/6.png new file mode 100644 index 0000000..25b08ec Binary files /dev/null and b/memes/lash/images/6.png differ diff --git a/memes/lash/images/7.png b/memes/lash/images/7.png new file mode 100644 index 0000000..c41034f Binary files /dev/null and b/memes/lash/images/7.png differ diff --git a/memes/lash/images/8.png b/memes/lash/images/8.png new file mode 100644 index 0000000..27868e2 Binary files /dev/null and b/memes/lash/images/8.png differ