-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 添加表情:小撅 * 🚨 auto fix by pre-commit hooks * 添加表情:鞭策 * 🚨 auto fix by pre-commit hooks --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
dc0cc9b
commit 333b2b3
Showing
10 changed files
with
33 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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=["鞭笞", "鞭打", "鞭挞", "鞭策"]) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.