Taka005 commited on
Commit
6f6fc81
·
1 Parent(s): c94f95b
Files changed (1) hide show
  1. main.py +6 -6
main.py CHANGED
@@ -74,7 +74,7 @@ def draw_text(im,ofs,string,font="fonts/MPLUSRounded1c-Regular.ttf",size=16,colo
74
  return (0,dy,real_y)
75
 
76
  content = "これはテストで生成されたものです"
77
- # 引用する
78
  img = BASE_WHITE_IMAGE.copy()
79
 
80
  icon = Image.open(ICON)
@@ -84,26 +84,26 @@ icon_filtered = ImageEnhance.Brightness(icon)
84
 
85
  img.paste(icon_filtered.enhance(0.7),(0,0))
86
 
87
- # 黒グラデ合成
88
  img.paste(BASE_GRADATION_IMAGE,(0,0),BASE_GRADATION_IMAGE)
89
 
90
- # テキスト合成
91
  tx = ImageDraw.Draw(img)
92
 
93
  # 文章描画
94
  tsize_t = draw_text(img,(890,270),content,size=45,color=(255,255,255,255),split_len=16,auto_expand=True)
95
 
96
  # 名前描画
97
- uname = 'Taka005#6668'
98
  name_y = tsize_t[2] + 40
99
- tsize_name = draw_text(img,(890,name_y),uname,size=25,color=(255,255,255,255),split_len=25,disable_dot_wrap=True)
100
 
101
  # ID描画
102
  id = '000000000000'
103
  id_y = name_y + tsize_name[1] + 4
104
  tsize_id = draw_text(img,(890,id_y),f"({id})",size=18,color=(180,180,180,255),split_len=45,disable_dot_wrap=True)
105
 
106
- # クレジット
107
  tx.text((1125, 694),"TakasumiBOT#7189",font=MPLUS_FONT_16,fill=(120,120,120,255))
108
 
109
  img.save("quote.png",quality=100)
 
74
  return (0,dy,real_y)
75
 
76
  content = "これはテストで生成されたものです"
77
+
78
  img = BASE_WHITE_IMAGE.copy()
79
 
80
  icon = Image.open(ICON)
 
84
 
85
  img.paste(icon_filtered.enhance(0.7),(0,0))
86
 
87
+ # グラデーション描画
88
  img.paste(BASE_GRADATION_IMAGE,(0,0),BASE_GRADATION_IMAGE)
89
 
90
+ # テキスト
91
  tx = ImageDraw.Draw(img)
92
 
93
  # 文章描画
94
  tsize_t = draw_text(img,(890,270),content,size=45,color=(255,255,255,255),split_len=16,auto_expand=True)
95
 
96
  # 名前描画
97
+ name = 'Taka005#6668'
98
  name_y = tsize_t[2] + 40
99
+ tsize_name = draw_text(img,(890,name_y),name,size=25,color=(255,255,255,255),split_len=25,disable_dot_wrap=True)
100
 
101
  # ID描画
102
  id = '000000000000'
103
  id_y = name_y + tsize_name[1] + 4
104
  tsize_id = draw_text(img,(890,id_y),f"({id})",size=18,color=(180,180,180,255),split_len=45,disable_dot_wrap=True)
105
 
106
+ # TakasumiBOT描画
107
  tx.text((1125, 694),"TakasumiBOT#7189",font=MPLUS_FONT_16,fill=(120,120,120,255))
108
 
109
  img.save("quote.png",quality=100)