Skip to content

Commit

Permalink
add meme gorilla_throw (#190)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
dkqdb66 and pre-commit-ci[bot] authored Nov 16, 2024
1 parent 10f756e commit 412db18
Show file tree
Hide file tree
Showing 43 changed files with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions meme_generator/memes/gorilla_throw/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
from datetime import datetime
from pathlib import Path

from pil_utils import BuildImage

from meme_generator import add_meme
from meme_generator.utils import FrameAlignPolicy, Maker, make_gif_or_combined_gif

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


def gorilla_throw(images: list[BuildImage], texts, args):
params = [
(74, 125, 24, 8, -135), # 28
(84, 119, 24, 8, -130), # 29
(111, 103, 22, 15, -100), # 30
(122, 95, 22, 15, -90), # 31
(136, 89, 25, 17, -87), # 32
(142, 60, 49, 22, -40), # 33
(134, 49, 66, 30, -30), # 34
(134, 49, 66, 30, -30), # 35
(116, 35, 92, 38, -25), # 36
(78, 26, 167, 73, -5), # 37
(-30, 0, 300, 180, 5), # 38
(-120, -85, 400, 240, 16), # 39
(-160, -125, 500, 300, 20), # 40
(-180, -180, 600, 360, 23), # 41
]

def maker(i: int) -> Maker:
def make(imgs: list[BuildImage]) -> BuildImage:
frame = BuildImage.open(img_dir / f"{i:2d}.png")
if i < 28:
return frame
x, y, w, h, a = params[i - 28]
nfsq = (
imgs[0]
.convert("RGBA")
.resize((w, h), keep_ratio=True)
.rotate(a, expand=True)
)
frame.paste(nfsq, (x, y), below=False, alpha=True)
return frame

return make

return make_gif_or_combined_gif(
images, maker, 42, 0.04, FrameAlignPolicy.extend_first
)


add_meme(
"gorilla_throw",
gorilla_throw,
min_images=1,
max_images=1,
keywords=["猩猩扔"],
date_created=datetime(2024, 11, 16),
date_modified=datetime(2024, 11, 16),
)
Binary file added meme_generator/memes/gorilla_throw/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/gorilla_throw/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/gorilla_throw/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/gorilla_throw/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/gorilla_throw/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.
Binary file added meme_generator/memes/gorilla_throw/images/ 5.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/gorilla_throw/images/ 6.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/gorilla_throw/images/ 7.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/gorilla_throw/images/ 8.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/gorilla_throw/images/ 9.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/gorilla_throw/images/10.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/gorilla_throw/images/11.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/gorilla_throw/images/12.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/gorilla_throw/images/13.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/gorilla_throw/images/14.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/gorilla_throw/images/15.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/gorilla_throw/images/16.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/gorilla_throw/images/17.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/gorilla_throw/images/18.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/gorilla_throw/images/19.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/gorilla_throw/images/20.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/gorilla_throw/images/21.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/gorilla_throw/images/22.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/gorilla_throw/images/23.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/gorilla_throw/images/24.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/gorilla_throw/images/25.png
Binary file added meme_generator/memes/gorilla_throw/images/26.png
Binary file added meme_generator/memes/gorilla_throw/images/27.png
Binary file added meme_generator/memes/gorilla_throw/images/28.png
Binary file added meme_generator/memes/gorilla_throw/images/29.png
Binary file added meme_generator/memes/gorilla_throw/images/30.png
Binary file added meme_generator/memes/gorilla_throw/images/31.png
Binary file added meme_generator/memes/gorilla_throw/images/32.png
Binary file added meme_generator/memes/gorilla_throw/images/33.png
Binary file added meme_generator/memes/gorilla_throw/images/34.png
Binary file added meme_generator/memes/gorilla_throw/images/35.png
Binary file added meme_generator/memes/gorilla_throw/images/36.png
Binary file added meme_generator/memes/gorilla_throw/images/37.png
Binary file added meme_generator/memes/gorilla_throw/images/38.png
Binary file added meme_generator/memes/gorilla_throw/images/39.png
Binary file added meme_generator/memes/gorilla_throw/images/40.png
Binary file added meme_generator/memes/gorilla_throw/images/41.png

0 comments on commit 412db18

Please sign in to comment.