CikeyQi commited on
Commit
ce6534f
1 Parent(s): f045361

Upload 222 files (#2)

Browse files

- Upload 222 files (b936df36a29daa7dd0d000fb89b0c320d14a1e97)

This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. meme_generator/memes/behead/__init__.py +34 -0
  2. meme_generator/memes/behead/images/0.png +0 -0
  3. meme_generator/memes/behead/images/1.png +0 -0
  4. meme_generator/memes/behead/images/10.png +0 -0
  5. meme_generator/memes/behead/images/11.png +0 -0
  6. meme_generator/memes/behead/images/12.png +0 -0
  7. meme_generator/memes/behead/images/13.png +0 -0
  8. meme_generator/memes/behead/images/14.png +0 -0
  9. meme_generator/memes/behead/images/15.png +0 -0
  10. meme_generator/memes/behead/images/16.png +0 -0
  11. meme_generator/memes/behead/images/17.png +0 -0
  12. meme_generator/memes/behead/images/18.png +0 -0
  13. meme_generator/memes/behead/images/19.png +0 -0
  14. meme_generator/memes/behead/images/2.png +0 -0
  15. meme_generator/memes/behead/images/20.png +0 -0
  16. meme_generator/memes/behead/images/3.png +0 -0
  17. meme_generator/memes/behead/images/4.png +0 -0
  18. meme_generator/memes/behead/images/5.png +0 -0
  19. meme_generator/memes/behead/images/6.png +0 -0
  20. meme_generator/memes/behead/images/7.png +0 -0
  21. meme_generator/memes/behead/images/8.png +0 -0
  22. meme_generator/memes/behead/images/9.png +0 -0
  23. meme_generator/memes/can_can_need/__init__.py +20 -0
  24. meme_generator/memes/can_can_need/images/0.jpg +0 -0
  25. meme_generator/memes/do/__init__.py +38 -0
  26. meme_generator/memes/do/images/0.png +0 -0
  27. meme_generator/memes/do/images/1.png +0 -0
  28. meme_generator/memes/do/images/2.png +0 -0
  29. meme_generator/memes/empathy/__init__.py +20 -0
  30. meme_generator/memes/empathy/images/0.png +0 -0
  31. meme_generator/memes/fleshlight/__init__.py +64 -0
  32. meme_generator/memes/fleshlight/images/0.png +0 -0
  33. meme_generator/memes/fleshlight/images/1.png +0 -0
  34. meme_generator/memes/fleshlight/images/10.png +0 -0
  35. meme_generator/memes/fleshlight/images/11.png +0 -0
  36. meme_generator/memes/fleshlight/images/12.png +0 -0
  37. meme_generator/memes/fleshlight/images/13.png +0 -0
  38. meme_generator/memes/fleshlight/images/14.png +0 -0
  39. meme_generator/memes/fleshlight/images/15.png +0 -0
  40. meme_generator/memes/fleshlight/images/16.png +0 -0
  41. meme_generator/memes/fleshlight/images/17.png +0 -0
  42. meme_generator/memes/fleshlight/images/18.png +0 -0
  43. meme_generator/memes/fleshlight/images/19.png +0 -0
  44. meme_generator/memes/fleshlight/images/2.png +0 -0
  45. meme_generator/memes/fleshlight/images/20.png +0 -0
  46. meme_generator/memes/fleshlight/images/21.png +0 -0
  47. meme_generator/memes/fleshlight/images/22.png +0 -0
  48. meme_generator/memes/fleshlight/images/23.png +0 -0
  49. meme_generator/memes/fleshlight/images/24.png +0 -0
  50. meme_generator/memes/fleshlight/images/25.png +0 -0
meme_generator/memes/behead/__init__.py ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from pathlib import Path
2
+ from typing import List
3
+
4
+ from meme_generator import add_meme
5
+ from meme_generator.utils import save_gif
6
+ from PIL.Image import Image as IMG
7
+ from pil_utils import BuildImage
8
+
9
+ img_dir = Path(__file__).parent / "images"
10
+
11
+
12
+ def behead(images: List[BuildImage], texts, args):
13
+ img = images[0].convert("RGBA").square().resize((75, 75))
14
+ # fmt: off
15
+ locs = [
16
+ (80, 72, 0), (83, 73, 0), (82, 73, 0),
17
+ (78, 73, 0), (72, 74, 0), (72, 75, 0),
18
+ (73, 76, 0), (73, 76, 0), (73, 76, 0),
19
+ (74, 76, 0), (74, 76, 0), (70, 73, 12),
20
+ (61, 62, 25), (49, 40, 45), (46, 30, 65),
21
+ (50, 35, 85), (39, 34, 105), (19, 45, 135),
22
+ (9, 91, 155), (6, 161, 175), (-4, 248, 180),
23
+ ]
24
+ # fmt: on
25
+ frames: List[IMG] = []
26
+ for i in range(21):
27
+ frame = BuildImage.open(img_dir / f"{i}.png")
28
+ x, y, angle = locs[i]
29
+ frame.paste(img.rotate(angle, expand=True), (x, y), below=True)
30
+ frames.append(frame.image)
31
+ return save_gif(frames, 0.05)
32
+
33
+
34
+ add_meme("behead", behead, min_images=1, max_images=1, keywords=["砍头", "斩首"])
meme_generator/memes/behead/images/0.png ADDED
meme_generator/memes/behead/images/1.png ADDED
meme_generator/memes/behead/images/10.png ADDED
meme_generator/memes/behead/images/11.png ADDED
meme_generator/memes/behead/images/12.png ADDED
meme_generator/memes/behead/images/13.png ADDED
meme_generator/memes/behead/images/14.png ADDED
meme_generator/memes/behead/images/15.png ADDED
meme_generator/memes/behead/images/16.png ADDED
meme_generator/memes/behead/images/17.png ADDED
meme_generator/memes/behead/images/18.png ADDED
meme_generator/memes/behead/images/19.png ADDED
meme_generator/memes/behead/images/2.png ADDED
meme_generator/memes/behead/images/20.png ADDED
meme_generator/memes/behead/images/3.png ADDED
meme_generator/memes/behead/images/4.png ADDED
meme_generator/memes/behead/images/5.png ADDED
meme_generator/memes/behead/images/6.png ADDED
meme_generator/memes/behead/images/7.png ADDED
meme_generator/memes/behead/images/8.png ADDED
meme_generator/memes/behead/images/9.png ADDED
meme_generator/memes/can_can_need/__init__.py ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from pathlib import Path
2
+ from typing import List
3
+
4
+ from meme_generator import add_meme
5
+ from pil_utils import BuildImage
6
+
7
+ img_dir = Path(__file__).parent / "images"
8
+
9
+
10
+ def can_can_need(images: List[BuildImage], texts, args):
11
+ frame = BuildImage.open(img_dir / "0.jpg")
12
+ frame.paste(
13
+ images[1].convert("RGBA").circle().resize((340, 340)), (120, 21), alpha=True
14
+ ).paste(
15
+ images[0].convert("RGBA").circle().resize((300, 300)), (611, 718), alpha=True
16
+ )
17
+ return frame.save_jpg()
18
+
19
+
20
+ add_meme("can_can_need", can_can_need, min_images=2, max_images=2, keywords=["看看你的"])
meme_generator/memes/can_can_need/images/0.jpg ADDED
meme_generator/memes/do/__init__.py ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from pathlib import Path
2
+ from typing import List
3
+
4
+ from meme_generator import add_meme
5
+ from meme_generator.utils import save_gif
6
+ from PIL.Image import Image as IMG
7
+ from pil_utils import BuildImage
8
+
9
+ img_dir = Path(__file__).parent / "images"
10
+
11
+
12
+ def do(images: List[BuildImage], texts, args):
13
+ self_locs = [(116, -8), (109, 3), (130, -10)]
14
+ user_locs = [(2, 177), (12, 172), (6, 158)]
15
+ self_head = (
16
+ images[0]
17
+ .convert("RGBA")
18
+ .resize((122, 122), keep_ratio=True)
19
+ .circle()
20
+ .rotate(15)
21
+ )
22
+ user_head = (
23
+ images[1]
24
+ .convert("RGBA")
25
+ .resize((112, 112), keep_ratio=True)
26
+ .circle()
27
+ .rotate(90)
28
+ )
29
+ frames: List[IMG] = []
30
+ for i in range(3):
31
+ frame = BuildImage.open(img_dir / f"{i}.png")
32
+ frame.paste(user_head, user_locs[i], alpha=True)
33
+ frame.paste(self_head, self_locs[i], alpha=True)
34
+ frames.append(frame.image)
35
+ return save_gif(frames, 0.05)
36
+
37
+
38
+ add_meme("do", do, min_images=2, max_images=2, keywords=["撅", "狠狠地撅"])
meme_generator/memes/do/images/0.png ADDED
meme_generator/memes/do/images/1.png ADDED
meme_generator/memes/do/images/2.png ADDED
meme_generator/memes/empathy/__init__.py ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from pathlib import Path
2
+ from typing import List
3
+
4
+ from meme_generator import add_meme
5
+ from pil_utils import BuildImage
6
+
7
+ img_dir = Path(__file__).parent / "images"
8
+
9
+
10
+ def empathy(images: List[BuildImage], texts, args):
11
+ frame = BuildImage.open(img_dir / "0.png")
12
+ frame.paste(
13
+ images[0].convert("RGBA").circle().resize((90, 90)).rotate(100),
14
+ (210, 425),
15
+ below=True,
16
+ )
17
+ return frame.save_jpg()
18
+
19
+
20
+ add_meme("empathy", empathy, min_images=1, max_images=1, keywords=["换位思考"])
meme_generator/memes/empathy/images/0.png ADDED
meme_generator/memes/fleshlight/__init__.py ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from pathlib import Path
2
+ from typing import List
3
+
4
+ from meme_generator import add_meme
5
+ from meme_generator.utils import FrameAlignPolicy, Maker, make_gif_or_combined_gif
6
+ from pil_utils import BuildImage
7
+
8
+ img_dir = Path(__file__).parent / "images"
9
+
10
+
11
+ def fleshlight(images: List[BuildImage], texts, args):
12
+ params = [
13
+ (((0, 6), (205, 0), (213, 157), (8, 171)), (117, 59)),
14
+ (((0, 6), (205, 0), (213, 157), (8, 171)), (117, 59)),
15
+ (((0, 6), (205, 0), (213, 157), (8, 171)), (117, 59)),
16
+ (((0, 7), (204, 0), (213, 157), (8, 172)), (118, 58)),
17
+ (((0, 6), (207, 0), (213, 158), (8, 173)), (119, 57)),
18
+ (((0, 6), (207, 0), (213, 158), (8, 173)), (119, 57)),
19
+ (((0, 6), (207, 0), (213, 158), (8, 173)), (119, 57)),
20
+ (((0, 6), (205, 0), (212, 157), (7, 171)), (121, 58)),
21
+ (((0, 6), (205, 0), (212, 157), (7, 171)), (121, 58)),
22
+ (((0, 6), (206, 0), (212, 158), (8, 172)), (121, 56)),
23
+ (((0, 6), (206, 0), (212, 158), (8, 172)), (121, 56)),
24
+ (((0, 6), (207, 0), (214, 157), (10, 171)), (121, 55)),
25
+ (((0, 7), (201, 0), (218, 154), (13, 169)), (121, 49)),
26
+ (((0, 7), (195, 0), (219, 147), (18, 162)), (118, 50)),
27
+ (((0, 4), (196, 0), (223, 133), (18, 143)), (114, 54)),
28
+ (((0, 0), (192, 1), (219, 121), (17, 124)), (115, 58)),
29
+ (((0, 0), (188, 5), (220, 110), (20, 107)), (112, 61)),
30
+ (((0, 0), (185, 15), (217, 86), (26, 73)), (108, 72)),
31
+ (((0, 0), (182, 19), (234, 67), (34, 44)), (102, 88)),
32
+ (((0, 0), (175, 25), (224, 55), (22, 23)), (111, 105)),
33
+ (((0, 0), (167, 29), (209, 49), (13, 14)), (121, 110)),
34
+ (((0, 0), (144, 27), (195, 46), (8, 8)), (135, 110)),
35
+ (((0, 0), (177, 36), (206, 59), (13, 18)), (129, 93)),
36
+ (((0, 0), (180, 38), (211, 69), (16, 25)), (126, 83)),
37
+ (((0, 0), (181, 28), (220, 70), (26, 39)), (119, 82)),
38
+ (((0, 0), (180, 17), (227, 65), (27, 45)), (115, 89)),
39
+ (((0, 0), (181, 15), (230, 63), (33, 46)), (110, 95)),
40
+ (((0, 0), (184, 24), (228, 73), (27, 47)), (91, 102)),
41
+ (((0, 0), (189, 8), (208, 73), (0, 66)), (83, 94)),
42
+ (((19, 0), (202, 25), (204, 85), (0, 58)), (63, 82)),
43
+ (((12, 0), (196, 18), (205, 70), (0, 50)), (70, 87)),
44
+ (((4, 0), (189, 17), (205, 74), (0, 53)), (82, 79)),
45
+ (((0, 0), (184, 18), (205, 72), (1, 51)), (91, 74)),
46
+ (((0, 0), (183, 17), (206, 69), (4, 52)), (92, 73)),
47
+ ]
48
+
49
+ def maker(i: int) -> Maker:
50
+ def make(img: BuildImage) -> BuildImage:
51
+ img = img.convert("RGBA").resize((210, 170), keep_ratio=True)
52
+ frame = BuildImage.open(img_dir / f"{i}.png")
53
+ points, pos = params[i]
54
+ frame.paste(img.perspective(points), pos, below=True)
55
+ return frame
56
+
57
+ return make
58
+
59
+ return make_gif_or_combined_gif(
60
+ images[0], maker, 34, 0.1, FrameAlignPolicy.extend_first
61
+ )
62
+
63
+
64
+ add_meme("fleshlight", fleshlight, min_images=1, max_images=1, keywords=["飞机杯"])
meme_generator/memes/fleshlight/images/0.png ADDED
meme_generator/memes/fleshlight/images/1.png ADDED
meme_generator/memes/fleshlight/images/10.png ADDED
meme_generator/memes/fleshlight/images/11.png ADDED
meme_generator/memes/fleshlight/images/12.png ADDED
meme_generator/memes/fleshlight/images/13.png ADDED
meme_generator/memes/fleshlight/images/14.png ADDED
meme_generator/memes/fleshlight/images/15.png ADDED
meme_generator/memes/fleshlight/images/16.png ADDED
meme_generator/memes/fleshlight/images/17.png ADDED
meme_generator/memes/fleshlight/images/18.png ADDED
meme_generator/memes/fleshlight/images/19.png ADDED
meme_generator/memes/fleshlight/images/2.png ADDED
meme_generator/memes/fleshlight/images/20.png ADDED
meme_generator/memes/fleshlight/images/21.png ADDED
meme_generator/memes/fleshlight/images/22.png ADDED
meme_generator/memes/fleshlight/images/23.png ADDED
meme_generator/memes/fleshlight/images/24.png ADDED
meme_generator/memes/fleshlight/images/25.png ADDED