|
|
@@ -5,6 +5,7 @@
|
|
|
3、按要求进行拼接
|
|
|
"""
|
|
|
|
|
|
+from ast import mod
|
|
|
import os
|
|
|
import settings
|
|
|
|
|
|
@@ -31,7 +32,7 @@ template_name = "xinnuo-1"
|
|
|
|
|
|
|
|
|
class DetailPicGet(DetailBase):
|
|
|
- need_view = ["俯视", "侧视", "后跟", "鞋底", "内里"]
|
|
|
+ need_view = ["俯视", "侧视", "后跟", "鞋底", "内里","组合","组合2","组合3"]
|
|
|
root = r"{}\resources\detail_temp\xinnuo\1".format(os.getcwd())
|
|
|
|
|
|
def __init__(
|
|
|
@@ -70,7 +71,6 @@ class DetailPicGet(DetailBase):
|
|
|
self.deal_pic_9,
|
|
|
self.deal_pic_10,
|
|
|
self.deal_pic_11,
|
|
|
- self.deal_pic_12,
|
|
|
self.deal_pic_13,
|
|
|
self.deal_pic_14,
|
|
|
self.deal_pic_15,
|
|
|
@@ -99,19 +99,18 @@ class DetailPicGet(DetailBase):
|
|
|
detailed_images.append(self.deal_pic_5())
|
|
|
detailed_images.append(self.deal_pic_6())
|
|
|
detailed_images.append(self.deal_pic_7())
|
|
|
- # detailed_images.append(self.deal_pic_8())
|
|
|
- # detailed_images.append(self.deal_pic_9())
|
|
|
- # detailed_images.append(self.deal_pic_10())
|
|
|
- # detailed_images.append(self.deal_pic_11())
|
|
|
- # detailed_images.append(self.deal_pic_12())
|
|
|
- # detailed_images.append(self.deal_pic_13())
|
|
|
- # detailed_images.append(self.deal_pic_14())
|
|
|
- # detailed_images.append(self.deal_pic_15())
|
|
|
- # detailed_images.append(self.deal_pic_16())
|
|
|
- # detailed_images.append(self.deal_pic_17())
|
|
|
- # detailed_images.append(self.deal_pic_18())
|
|
|
- # detailed_images.append(self.deal_pic_19())
|
|
|
- # detailed_images.append(self.deal_pic_20())
|
|
|
+ detailed_images.append(self.deal_pic_8())
|
|
|
+ detailed_images.append(self.deal_pic_9())
|
|
|
+ detailed_images.append(self.deal_pic_10())
|
|
|
+ detailed_images.append(self.deal_pic_11())
|
|
|
+ detailed_images.append(self.deal_pic_13())
|
|
|
+ detailed_images.append(self.deal_pic_14())
|
|
|
+ detailed_images.append(self.deal_pic_15())
|
|
|
+ detailed_images.append(self.deal_pic_16())
|
|
|
+ detailed_images.append(self.deal_pic_17())
|
|
|
+ detailed_images.append(self.deal_pic_18())
|
|
|
+ detailed_images.append(self.deal_pic_19())
|
|
|
+ detailed_images.append(self.deal_pic_20())
|
|
|
|
|
|
img = self.add_pic(detailed_images)
|
|
|
img.save(r"{}/{}.jpg".format(self.out_put_dir, self.goods_no, format="JPEG"))
|
|
|
@@ -335,93 +334,69 @@ class DetailPicGet(DetailBase):
|
|
|
# 功能展示与卖点
|
|
|
def deal_pic_8(self):
|
|
|
detailed_images = []
|
|
|
- detailed_images.append(PictureProcessing(r"{}\8.jpg".format(self.root)))
|
|
|
- # goods_art_no_list = list(self.data.keys())
|
|
|
- # goods_art_no = goods_art_no_list[0]
|
|
|
- # color_name_list = ["侧视", "鞋底", "俯视"]
|
|
|
-
|
|
|
- # font_1 = ImageFont.truetype(r"resources\ttf\puhui\Bold.ttf", 42) # 卖点标题1
|
|
|
- # font_2 = ImageFont.truetype(r"resources\ttf\puhui\Bold.ttf", 32) # 卖点标题2
|
|
|
- # font_3 = ImageFont.truetype(r"resources\ttf\puhui\Medium.ttf", 26) # 卖点描述1
|
|
|
-
|
|
|
- # # =====卖点1,展示后跟========
|
|
|
- # for color_name in color_name_list:
|
|
|
- # bg = PictureProcessing(r"{}\t (13).png".format(self.root))
|
|
|
- # pp_jpg, pp_png = self.image_one_pic(
|
|
|
- # return_orign=True,
|
|
|
- # goods_art_no=goods_art_no,
|
|
|
- # name=color_name,
|
|
|
- # )
|
|
|
- # temp_bg = PictureProcessing("RGB", (536, 424), (214, 214, 214))
|
|
|
- # if color_name == "侧视":
|
|
|
- # pp_png = pp_png.resize(value=990)
|
|
|
- # temp_bg = temp_bg.paste_img(top_img=pp_png, base="es")
|
|
|
- # shoe_paste_base = "wc"
|
|
|
- # text_1, text_2 = self.get_text_value("卖点1标题", subsection_len=2)
|
|
|
- # text_3 = self.get_text_value("卖点1介绍")
|
|
|
- # text_paste_base = "ec"
|
|
|
- # text_paste_value = (312, 0)
|
|
|
-
|
|
|
- # if color_name == "鞋底":
|
|
|
- # pp_png = pp_png.resize(value=1000)
|
|
|
- # temp_bg = temp_bg.paste_img(top_img=pp_png, base="wc", value=(0, 0))
|
|
|
- # shoe_paste_base = "ec"
|
|
|
- # text_1, text_2 = self.get_text_value("卖点2标题", subsection_len=2)
|
|
|
- # text_3 = self.get_text_value("卖点2介绍")
|
|
|
- # text_paste_base = "wc"
|
|
|
- # text_paste_value = (312, 0)
|
|
|
- # if color_name == "俯视":
|
|
|
- # pp_png = pp_png.resize(value=1418)
|
|
|
- # temp_bg = temp_bg.paste_img(top_img=pp_png, base="cc")
|
|
|
- # shoe_paste_base = "wc"
|
|
|
- # text_1, text_2 = self.get_text_value("卖点3标题", subsection_len=2)
|
|
|
- # text_3 = self.get_text_value("卖点3介绍")
|
|
|
- # text_paste_base = "ec"
|
|
|
- # text_paste_value = (312, 0)
|
|
|
-
|
|
|
- # # 添加圆角
|
|
|
- # temp_bg = temp_bg.radius(circular_pos=(1, 1, 1, 1), value=50)
|
|
|
- # # 粘贴到背景上
|
|
|
- # temp_bg = temp_bg.paste_img_invert(
|
|
|
- # top_img=bg, base=shoe_paste_base, value=(99, 0)
|
|
|
- # )
|
|
|
- # text_list = []
|
|
|
- # # 卖点主标题
|
|
|
- # text_list.append(
|
|
|
- # {
|
|
|
- # "text": text_1,
|
|
|
- # "font": font_1,
|
|
|
- # "fill": (2, 2, 2),
|
|
|
- # "spacing": 0,
|
|
|
- # }
|
|
|
- # )
|
|
|
- # text_list.append(
|
|
|
- # {
|
|
|
- # "text": text_2,
|
|
|
- # "font": font_2,
|
|
|
- # "fill": (43, 43, 43),
|
|
|
- # "spacing": 10,
|
|
|
- # }
|
|
|
- # )
|
|
|
- # # 主标题
|
|
|
- # text_list.append(
|
|
|
- # {
|
|
|
- # "text": text_3,
|
|
|
- # "font": font_3,
|
|
|
- # "fill": (165, 165, 165),
|
|
|
- # }
|
|
|
- # )
|
|
|
- # text_image = self.add_text_list(text_list, spacing=15, base="nc")
|
|
|
- # if text_image:
|
|
|
- # temp_bg = temp_bg.paste_img(
|
|
|
- # top_img=text_image,
|
|
|
- # base=text_paste_base,
|
|
|
- # value=(
|
|
|
- # text_paste_value[0] - text_image.width / 2,
|
|
|
- # text_paste_value[1],
|
|
|
- # ),
|
|
|
- # )
|
|
|
- # detailed_images.append(temp_bg)
|
|
|
+ pp_bg = PictureProcessing(r"{}\7.jpg".format(self.root))
|
|
|
+ # detailed_images.append(pp_bg)
|
|
|
+ goods_art_no_list = list(self.data.keys())
|
|
|
+ all_color_name = []
|
|
|
+ bg_color = (253, 250, 242)
|
|
|
+ text_color = (70, 48, 41)
|
|
|
+ font = ImageFont.truetype(r"resources\ttf\puhui\Medium.ttf", 25)
|
|
|
+ goods_art_images = []
|
|
|
+ total_height = 0
|
|
|
+ for index, goods_art_no in enumerate(goods_art_no_list):
|
|
|
+ pp_jpg = self.get_overlay_pic_from_dict(
|
|
|
+ goods_art_no=goods_art_no,
|
|
|
+ color_name="侧视",
|
|
|
+ bg_color=bg_color,
|
|
|
+ )
|
|
|
+ if pp_jpg is None:
|
|
|
+ continue
|
|
|
+ pp_jpg = pp_jpg.resize(value=pp_bg.width/2.5)
|
|
|
+ color_name = self.goods_no_value["货号资料"][index]["颜色名称"]
|
|
|
+ all_color_name.append(color_name)
|
|
|
+ text_bg = PictureProcessing("RGB", (pp_jpg.width, 50), bg_color)
|
|
|
+ text_bg = text_bg.get_text_image_advanced(
|
|
|
+ value=(0, 0),
|
|
|
+ font=font,
|
|
|
+ text="● {}".format(color_name),
|
|
|
+ align="center",
|
|
|
+ # anchor="mm",
|
|
|
+ spacing=5,
|
|
|
+ fill=text_color,
|
|
|
+ return_mode="image",
|
|
|
+ margins=(0, 0, 0, 0),
|
|
|
+ )
|
|
|
+ _bg = PictureProcessing(
|
|
|
+ "RGB",
|
|
|
+ (pp_bg.width / 2, pp_jpg.height+200),
|
|
|
+ bg_color,
|
|
|
+ )
|
|
|
+ if (index+1) == 1:
|
|
|
+ total_height += _bg.height
|
|
|
+ if (index + 1) % 2 != 0 and (index + 1) != 1:
|
|
|
+ total_height += _bg.height
|
|
|
+ print("高度:", total_height)
|
|
|
+ _bg = _bg.paste_img(top_img=pp_jpg, base="center")
|
|
|
+ _bg = _bg.paste_img(
|
|
|
+ top_img=text_bg, value=(pp_jpg.width / 2, pp_jpg.height+100)
|
|
|
+ )
|
|
|
+ goods_art_images.append(_bg)
|
|
|
+ rows = 2
|
|
|
+ shoes_bg = PictureProcessing(
|
|
|
+ ).horizontal_distribution(
|
|
|
+ pp_list=goods_art_images,
|
|
|
+ bg_width=pp_bg.width,
|
|
|
+ margins=(0, 0, 0, 0),
|
|
|
+ line_spacing=0,
|
|
|
+ number_per_row=rows,
|
|
|
+ )
|
|
|
+ main_bg = PictureProcessing(
|
|
|
+ "RGB",
|
|
|
+ (pp_bg.width, total_height),
|
|
|
+ bg_color,
|
|
|
+ )
|
|
|
+ main_bg.paste_img(top_img=shoes_bg)
|
|
|
+ detailed_images.append(main_bg)
|
|
|
return PictureProcessing(im=self.add_pic(detailed_images))
|
|
|
|
|
|
# 添加尺码表
|
|
|
@@ -434,135 +409,366 @@ class DetailPicGet(DetailBase):
|
|
|
detailed_images = []
|
|
|
# 角度展示标题
|
|
|
detailed_images.append(PictureProcessing(r"{}\10.jpg".format(self.root)))
|
|
|
- # # 添加颜色名称字体
|
|
|
- # font_color = ImageFont.truetype(r"resources\ttf\puhui\Bold.ttf", 30)
|
|
|
-
|
|
|
- # for goods_art_no_dict in self.goods_no_value["货号资料"]:
|
|
|
- # color_name = goods_art_no_dict["颜色名称"]
|
|
|
- # goods_art_no = goods_art_no_dict["货号"]
|
|
|
- # # ====颜色主图
|
|
|
- # pp_1 = self.get_overlay_pic_from_dict(
|
|
|
- # goods_art_no=goods_art_no, color_name="俯视", bg_color=(255, 255, 255)
|
|
|
- # )
|
|
|
- # pp_1: PictureProcessing
|
|
|
- # pp_1 = pp_1.resize(value=865)
|
|
|
- # pp_1 = pp_1.paste_img_invert(
|
|
|
- # top_img=PictureProcessing(
|
|
|
- # "RGB", (1152, pp_1.height + 100), (255, 255, 255)
|
|
|
- # ),
|
|
|
- # base="sc",
|
|
|
- # )
|
|
|
- # # 粘贴颜色名称
|
|
|
- # pp_1 = pp_1.get_text_image_advanced(
|
|
|
- # value=(90, 50),
|
|
|
- # font=font_color,
|
|
|
- # text=color_name,
|
|
|
- # spacing=1,
|
|
|
- # return_mode="image",
|
|
|
- # )
|
|
|
- # pp_1 = pp_1.paste_img_invert(
|
|
|
- # top_img=PictureProcessing("RGB", (1200, pp_1.height), (243, 243, 243)),
|
|
|
- # base="cc",
|
|
|
- # )
|
|
|
-
|
|
|
- # detailed_images.append(pp_1)
|
|
|
-
|
|
|
- # # 添加处理各个角度
|
|
|
- # view_name_list = ["内里", "鞋底", "后跟", "侧视"]
|
|
|
- # color_pic_list = []
|
|
|
- # for view_name in view_name_list:
|
|
|
- # _, pp_png = self.image_one_pic(
|
|
|
- # return_orign=True,
|
|
|
- # goods_art_no=goods_art_no,
|
|
|
- # name=view_name,
|
|
|
- # )
|
|
|
- # temp_bg = PictureProcessing("RGB", (546, 338), (243, 243, 243))
|
|
|
-
|
|
|
- # # if view_name == "内里":
|
|
|
- # # pp_png = pp_png.resize(base_by_box=(temp_bg.width * 0.9, temp_bg.height * 0.9))
|
|
|
- # # if view_name == "鞋底":
|
|
|
- # # pp_png = pp_png.resize(base_by_box=(temp_bg.width * 0.9, temp_bg.height * 0.9))
|
|
|
- # # if view_name == "后跟":
|
|
|
- # # pp_png = pp_png.resize(base_by_box=(temp_bg.width * 0.9, temp_bg.height * 0.9))
|
|
|
- # # if view_name == "侧视":
|
|
|
- # # pp_png = pp_png.resize(base_by_box=(temp_bg.width * 0.9, temp_bg.height * 0.9))
|
|
|
-
|
|
|
- # pp_png = pp_png.resize(
|
|
|
- # base_by_box=(temp_bg.width * 0.9, temp_bg.height * 0.9)
|
|
|
- # )
|
|
|
-
|
|
|
- # temp_bg = temp_bg.paste_img(top_img=pp_png, base="cc")
|
|
|
- # temp_bg = temp_bg.radius(value=30)
|
|
|
- # color_pic_list.append(temp_bg)
|
|
|
-
|
|
|
- # # 颜色列表进行等分展示
|
|
|
- # all_color_pp = PictureProcessing().horizontal_distribution(
|
|
|
- # color_pic_list, bg_width=1114, line_spacing=10, number_per_row=2
|
|
|
- # )
|
|
|
- # all_color_pp = all_color_pp.paste_img_invert(
|
|
|
- # top_img=PictureProcessing(
|
|
|
- # "RGB", (1152, all_color_pp.height + 100), (255, 255, 255)
|
|
|
- # ),
|
|
|
- # base="cc",
|
|
|
- # )
|
|
|
- # all_color_pp = all_color_pp.paste_img_invert(
|
|
|
- # top_img=PictureProcessing(
|
|
|
- # "RGB", (1200, all_color_pp.height), (243, 243, 243)
|
|
|
- # ),
|
|
|
- # base="cc",
|
|
|
- # )
|
|
|
- # detailed_images.append(all_color_pp)
|
|
|
-
|
|
|
- # # 添加底部圆弧分割线
|
|
|
- # b_bg = PictureProcessing("RGB", (1152, 30), (255, 255, 255))
|
|
|
- # b_bg = b_bg.radius(circular_pos=(0, 0, 1, 1), value=30)
|
|
|
- # b_bg = b_bg.paste_img_invert(
|
|
|
- # top_img=PictureProcessing("RGB", (1200, b_bg.height + 50), (243, 243, 243)),
|
|
|
- # base="nc",
|
|
|
- # )
|
|
|
- # detailed_images.append(b_bg)
|
|
|
-
|
|
|
- # # return PictureProcessing(im=self.add_pic(detailed_images))
|
|
|
return self.pp_pic_subsection(
|
|
|
PictureProcessing(im=self.add_pic(detailed_images))
|
|
|
)
|
|
|
|
|
|
# 添加注意事项
|
|
|
def deal_pic_11(self):
|
|
|
+ detailed_images = []
|
|
|
image_path = r"{}\11.jpg".format(self.root)
|
|
|
- return PictureProcessing(image_path)
|
|
|
-
|
|
|
- def deal_pic_12(self):
|
|
|
- image_path = r"{}\12.jpg".format(self.root)
|
|
|
- return PictureProcessing(image_path)
|
|
|
+ pp_bg = PictureProcessing(image_path)
|
|
|
+ goods_art_no_list = list(self.data.keys())
|
|
|
+ pp_jpg_1, pp_png_1 = self.image_one_pic(
|
|
|
+ return_orign=True,
|
|
|
+ goods_art_no=goods_art_no_list[0],
|
|
|
+ name="俯视",
|
|
|
+ )
|
|
|
+ pp_jpg_1 = pp_jpg_1.resize(value=1400)
|
|
|
+ pp_png_1 = pp_png_1.resize(value=1400)
|
|
|
+ pp_bg = pp_bg.to_overlay_pic_advance(
|
|
|
+ mode="pixel",
|
|
|
+ top_img=pp_jpg_1,
|
|
|
+ base="nw",
|
|
|
+ value=(0, pp_bg.height - pp_jpg_1.height),
|
|
|
+ top_png_img=pp_png_1,
|
|
|
+ )
|
|
|
+ font_main = ImageFont.truetype(
|
|
|
+ r"resources\ttf\puhui\Medium.ttf", 58
|
|
|
+ ) # 设计理念
|
|
|
+ mainTitle = self.get_text_value("细节亮点主标题")
|
|
|
+ subTitle = self.get_text_value("细节亮点副标题")
|
|
|
+ pp_bg.get_text_image_advanced(
|
|
|
+ value=(pp_bg.width/2, 219),
|
|
|
+ font=font_main,
|
|
|
+ text=mainTitle,
|
|
|
+ align="center",
|
|
|
+ anchor="ma",
|
|
|
+ spacing=5,
|
|
|
+ fill=(60, 40, 29),
|
|
|
+ return_mode="image",
|
|
|
+ margins=(0, 0, 0, 0),
|
|
|
+ )
|
|
|
+ font_sub = ImageFont.truetype(r"resources\ttf\puhui\Light.ttf", 36) # 设计理念
|
|
|
+ pp_bg.get_text_image_advanced(
|
|
|
+ value=(pp_bg.width / 2, 313),
|
|
|
+ font=font_sub,
|
|
|
+ text=subTitle,
|
|
|
+ align="center",
|
|
|
+ anchor="ma",
|
|
|
+ spacing=5,
|
|
|
+ fill=(60, 40, 29),
|
|
|
+ return_mode="image",
|
|
|
+ margins=(0, 0, 0, 0),
|
|
|
+ )
|
|
|
+ detailed_images.append(pp_bg)
|
|
|
+ bg_12_image_path = r"{}\12.jpg".format(self.root)
|
|
|
+ bg_12 = PictureProcessing(bg_12_image_path)
|
|
|
+ detailed_images.append(bg_12)
|
|
|
+ return self.pp_pic_subsection(
|
|
|
+ PictureProcessing(im=self.add_pic(detailed_images))
|
|
|
+ )
|
|
|
|
|
|
def deal_pic_13(self):
|
|
|
+ detailed_images = []
|
|
|
image_path = r"{}\13.jpg".format(self.root)
|
|
|
- return PictureProcessing(image_path)
|
|
|
+ pp_bg = PictureProcessing(image_path)
|
|
|
+ image_path_1 = r"{}\13_1.png".format(self.root)
|
|
|
+ pp_bg_1 = PictureProcessing(image_path_1)
|
|
|
+ font_main = ImageFont.truetype(
|
|
|
+ r"resources\ttf\puhui\Medium.ttf", 58
|
|
|
+ ) # 设计理念
|
|
|
+ pp_bg.get_text_image_advanced(
|
|
|
+ value=(pp_bg.width / 2, 168),
|
|
|
+ font=font_main,
|
|
|
+ text="经典系带",
|
|
|
+ align="center",
|
|
|
+ anchor="ma",
|
|
|
+ spacing=5,
|
|
|
+ fill=(60, 40, 29),
|
|
|
+ return_mode="image",
|
|
|
+ margins=(0, 0, 0, 0),
|
|
|
+ )
|
|
|
+ font_sub = ImageFont.truetype(r"resources\ttf\puhui\Light.ttf", 36) # 设计理念
|
|
|
+ pp_bg.get_text_image_advanced(
|
|
|
+ value=(pp_bg.width / 2, 261),
|
|
|
+ font=font_sub,
|
|
|
+ text="松紧自由调节",
|
|
|
+ align="center",
|
|
|
+ anchor="ma",
|
|
|
+ spacing=5,
|
|
|
+ fill=(60, 40, 29),
|
|
|
+ return_mode="image",
|
|
|
+ margins=(0, 0, 0, 0),
|
|
|
+ )
|
|
|
+ goods_art_no_list = list(self.data.keys())
|
|
|
+ pp_jpg_1, pp_png_1 = self.image_one_pic(
|
|
|
+ return_orign=True,
|
|
|
+ goods_art_no=goods_art_no_list[0],
|
|
|
+ name="俯视",
|
|
|
+ )
|
|
|
+ pp_jpg_1 = pp_jpg_1.resize(value=1500)
|
|
|
+ pp_png_1 = pp_png_1.resize(value=1500)
|
|
|
+ pp_bg = pp_bg.to_overlay_pic_advance(
|
|
|
+ mode="pixel",
|
|
|
+ top_img=pp_jpg_1,
|
|
|
+ base="cs",
|
|
|
+ value=(0, - pp_jpg_1.height/4),
|
|
|
+ top_png_img=pp_png_1,
|
|
|
+ )
|
|
|
+ pp_bg.paste_img(top_img=pp_bg_1)
|
|
|
+ detailed_images.append(pp_bg)
|
|
|
+ return self.pp_pic_subsection(
|
|
|
+ PictureProcessing(im=self.add_pic(detailed_images))
|
|
|
+ )
|
|
|
|
|
|
def deal_pic_14(self):
|
|
|
+ # 场景展示
|
|
|
+ detailed_images = []
|
|
|
image_path = r"{}\14.jpg".format(self.root)
|
|
|
- return PictureProcessing(image_path)
|
|
|
+ pp_bg_14 = PictureProcessing(image_path)
|
|
|
+ goods_art_no_list = list(self.data.keys())
|
|
|
+ pp_jpg_1, pp_png_1 = self.image_one_pic(
|
|
|
+ return_orign=True,
|
|
|
+ goods_art_no=goods_art_no_list[0],
|
|
|
+ name="组合",
|
|
|
+ )
|
|
|
+ pp_jpg_1 = pp_jpg_1.resize(value=pp_bg_14.width)
|
|
|
+ pp_png_1 = pp_png_1.resize(value=pp_bg_14.width)
|
|
|
+ pp_bg_14 = pp_bg_14.to_overlay_pic_advance(
|
|
|
+ mode="pixel",
|
|
|
+ top_img=pp_jpg_1,
|
|
|
+ base="cc",
|
|
|
+ value=(0, 0),
|
|
|
+ top_png_img=pp_png_1,
|
|
|
+ )
|
|
|
+ detailed_images.append(pp_bg_14)
|
|
|
+ return self.pp_pic_subsection(
|
|
|
+ PictureProcessing(im=self.add_pic(detailed_images))
|
|
|
+ )
|
|
|
|
|
|
def deal_pic_15(self):
|
|
|
+ detailed_images = []
|
|
|
image_path = r"{}\15.jpg".format(self.root)
|
|
|
- return PictureProcessing(image_path)
|
|
|
+ pp_bg_15 = PictureProcessing(image_path)
|
|
|
+ goods_art_no_list = list(self.data.keys())
|
|
|
+ pp_jpg_1, pp_png_1 = self.image_one_pic(
|
|
|
+ return_orign=True,
|
|
|
+ goods_art_no=goods_art_no_list[0],
|
|
|
+ name="组合2",
|
|
|
+ )
|
|
|
+ pp_jpg_1 = pp_jpg_1.resize(value=pp_bg_15.width)
|
|
|
+ pp_png_1 = pp_png_1.resize(value=pp_bg_15.width)
|
|
|
+ pp_bg_15 = pp_bg_15.to_overlay_pic_advance(
|
|
|
+ mode="pixel",
|
|
|
+ top_img=pp_jpg_1,
|
|
|
+ base="cc",
|
|
|
+ value=(0, 0),
|
|
|
+ top_png_img=pp_png_1,
|
|
|
+ )
|
|
|
+ detailed_images.append(pp_bg_15)
|
|
|
+ return self.pp_pic_subsection(
|
|
|
+ PictureProcessing(im=self.add_pic(detailed_images))
|
|
|
+ )
|
|
|
|
|
|
def deal_pic_16(self):
|
|
|
+ detailed_images = []
|
|
|
image_path = r"{}\16.jpg".format(self.root)
|
|
|
- return PictureProcessing(image_path)
|
|
|
+ pp_bg_16 = PictureProcessing(image_path)
|
|
|
+ goods_art_no_list = list(self.data.keys())
|
|
|
+ pp_jpg_1, pp_png_1 = self.image_one_pic(
|
|
|
+ return_orign=True,
|
|
|
+ goods_art_no=goods_art_no_list[0],
|
|
|
+ name="组合3",
|
|
|
+ )
|
|
|
+ pp_jpg_1 = pp_jpg_1.resize(value=pp_bg_16.width)
|
|
|
+ pp_png_1 = pp_png_1.resize(value=pp_bg_16.width)
|
|
|
+ pp_bg_16 = pp_bg_16.to_overlay_pic_advance(
|
|
|
+ mode="pixel",
|
|
|
+ top_img=pp_jpg_1,
|
|
|
+ base="cc",
|
|
|
+ value=(0, 0),
|
|
|
+ top_png_img=pp_png_1,
|
|
|
+ )
|
|
|
+ detailed_images.append(pp_bg_16)
|
|
|
+ return self.pp_pic_subsection(
|
|
|
+ PictureProcessing(im=self.add_pic(detailed_images))
|
|
|
+ )
|
|
|
|
|
|
def deal_pic_17(self):
|
|
|
+ # 产品细节
|
|
|
image_path = r"{}\17.jpg".format(self.root)
|
|
|
- return PictureProcessing(image_path)
|
|
|
+ image_path_1 = r"{}\17_1.png".format(self.root)
|
|
|
+ detailed_images = []
|
|
|
+ pp_bg_1 = PictureProcessing(image_path_1)
|
|
|
+ pp_bg = PictureProcessing(image_path)
|
|
|
+ goods_art_no_list = list(self.data.keys())
|
|
|
+ pp_jpg_1, pp_png_1 = self.image_one_pic(
|
|
|
+ return_orign=True,
|
|
|
+ goods_art_no=goods_art_no_list[0],
|
|
|
+ name="俯视",
|
|
|
+ )
|
|
|
+ pp_jpg_1 = pp_jpg_1.resize(value=pp_bg.width+100)
|
|
|
+ pp_png_1 = pp_png_1.resize(value=pp_bg.width + 100)
|
|
|
+ pp_bg = pp_bg.to_overlay_pic_advance(
|
|
|
+ mode="pixel",
|
|
|
+ top_img=pp_jpg_1,
|
|
|
+ base="cs",
|
|
|
+ value=(0, 0),
|
|
|
+ top_png_img=pp_png_1,
|
|
|
+ )
|
|
|
+ mainTitle = self.get_text_value("艺-主标题")
|
|
|
+ subTitle = self.get_text_value("艺-副标题")
|
|
|
+ font_main = ImageFont.truetype(
|
|
|
+ r"resources\ttf\puhui\Medium.ttf", 30
|
|
|
+ ) # 设计理念
|
|
|
+ pp_bg.get_text_image_advanced(
|
|
|
+ value=(113, 545),
|
|
|
+ font=font_main,
|
|
|
+ text=mainTitle,
|
|
|
+ align="left",
|
|
|
+ # anchor="ma",
|
|
|
+ spacing=5,
|
|
|
+ fill=(60, 40, 29),
|
|
|
+ return_mode="image",
|
|
|
+ margins=(0, 0, 0, 0),
|
|
|
+ )
|
|
|
+ font_sub = ImageFont.truetype(r"resources\ttf\puhui\Light.ttf", 24) # 设计理念
|
|
|
+ pp_bg.get_text_image_advanced(
|
|
|
+ value=(113, 602),
|
|
|
+ font=font_sub,
|
|
|
+ text=subTitle,
|
|
|
+ align="left",
|
|
|
+ # anchor="ma",
|
|
|
+ spacing=5,
|
|
|
+ fill=(60, 40, 29),
|
|
|
+ return_mode="image",
|
|
|
+ margins=(0, 0, 0, 0),
|
|
|
+ )
|
|
|
+ pp_bg.paste_img(top_img=pp_bg_1)
|
|
|
+ detailed_images.append(pp_bg)
|
|
|
+ return self.pp_pic_subsection(
|
|
|
+ PictureProcessing(im=self.add_pic(detailed_images))
|
|
|
+ )
|
|
|
|
|
|
def deal_pic_18(self):
|
|
|
image_path = r"{}\18.jpg".format(self.root)
|
|
|
- return PictureProcessing(image_path)
|
|
|
+ image_path_1 = r"{}\18_1.png".format(self.root)
|
|
|
+ detailed_images = []
|
|
|
+ pp_bg_1 = PictureProcessing(image_path_1)
|
|
|
+ pp_bg = PictureProcessing(image_path)
|
|
|
+ goods_art_no_list = list(self.data.keys())
|
|
|
+ pp_jpg_1, pp_png_1 = self.image_one_pic(
|
|
|
+ return_orign=True,
|
|
|
+ goods_art_no=goods_art_no_list[0],
|
|
|
+ name="侧视",
|
|
|
+ )
|
|
|
+ pp_jpg_1 = pp_jpg_1.resize(value=1400)
|
|
|
+ pp_png_1 = pp_png_1.resize(value=1400)
|
|
|
+ pp_bg = pp_bg.to_overlay_pic_advance(
|
|
|
+ mode="pixel",
|
|
|
+ top_img=pp_jpg_1,
|
|
|
+ base="cs",
|
|
|
+ value=(-pp_jpg_1.width/3, 0),
|
|
|
+ top_png_img=pp_png_1,
|
|
|
+ )
|
|
|
+ mainTitle = self.get_text_value("跟-主标题")
|
|
|
+ subTitle = self.get_text_value("跟-副标题")
|
|
|
+ gengao = self.get_text_value("跟高")
|
|
|
+ font_main = ImageFont.truetype(
|
|
|
+ r"resources\ttf\puhui\Medium.ttf", 30
|
|
|
+ ) # 设计理念
|
|
|
+ pp_bg.get_text_image_advanced(
|
|
|
+ value=(441, 220),
|
|
|
+ font=font_main,
|
|
|
+ text=mainTitle,
|
|
|
+ align="right",
|
|
|
+ # anchor="rs",
|
|
|
+ spacing=5,
|
|
|
+ fill=(60, 40, 29),
|
|
|
+ return_mode="image",
|
|
|
+ margins=(0, 0, 0, 0),
|
|
|
+ )
|
|
|
+ font_sub = ImageFont.truetype(r"resources\ttf\puhui\Light.ttf", 24) # 设计理念
|
|
|
+ pp_bg.get_text_image_advanced(
|
|
|
+ value=(441, 272),
|
|
|
+ font=font_sub,
|
|
|
+ text=subTitle,
|
|
|
+ align="right",
|
|
|
+ # anchor="ls",
|
|
|
+ spacing=5,
|
|
|
+ fill=(60, 40, 29),
|
|
|
+ return_mode="image",
|
|
|
+ margins=(0, 0, 0, 0),
|
|
|
+ )
|
|
|
+ pp_bg.get_text_image_advanced(
|
|
|
+ value=(605, 648),
|
|
|
+ font=font_main,
|
|
|
+ text=gengao,
|
|
|
+ align="right",
|
|
|
+ # anchor="ls",
|
|
|
+ spacing=5,
|
|
|
+ fill=(60, 40, 29),
|
|
|
+ return_mode="image",
|
|
|
+ margins=(0, 0, 0, 0),
|
|
|
+ )
|
|
|
+ pp_bg.paste_img(top_img=pp_bg_1)
|
|
|
+ detailed_images.append(pp_bg)
|
|
|
+ return self.pp_pic_subsection(
|
|
|
+ PictureProcessing(im=self.add_pic(detailed_images))
|
|
|
+ )
|
|
|
|
|
|
def deal_pic_19(self):
|
|
|
+ detailed_images = []
|
|
|
image_path = r"{}\19.jpg".format(self.root)
|
|
|
- return PictureProcessing(image_path)
|
|
|
+ pp_bg = PictureProcessing(image_path)
|
|
|
+ # 鞋底
|
|
|
+ goods_art_no_list = list(self.data.keys())
|
|
|
+ pp_jpg_1, pp_png_1 = self.image_one_pic(
|
|
|
+ return_orign=True,
|
|
|
+ goods_art_no=goods_art_no_list[0],
|
|
|
+ name="鞋底",
|
|
|
+ )
|
|
|
+ pp_jpg_1 = pp_jpg_1.resize(value=pp_bg.width)
|
|
|
+ pp_png_1 = pp_png_1.resize(value=pp_bg.width)
|
|
|
+ pp_bg = pp_bg.to_overlay_pic_advance(
|
|
|
+ mode="pixel",
|
|
|
+ top_img=pp_jpg_1,
|
|
|
+ base="center",
|
|
|
+ value=(0, 200),
|
|
|
+ top_png_img=pp_png_1,
|
|
|
+ )
|
|
|
+ mainTitle = self.get_text_value("底-主标题")
|
|
|
+ subTitle = self.get_text_value("底-副标题")
|
|
|
+ font_main = ImageFont.truetype(
|
|
|
+ r"resources\ttf\puhui\Medium.ttf", 30
|
|
|
+ ) # 设计理念
|
|
|
+ pp_bg.get_text_image_advanced(
|
|
|
+ value=(114, 259),
|
|
|
+ font=font_main,
|
|
|
+ text=mainTitle,
|
|
|
+ align="left",
|
|
|
+ # anchor="rs",
|
|
|
+ spacing=5,
|
|
|
+ fill=(60, 40, 29),
|
|
|
+ return_mode="image",
|
|
|
+ margins=(0, 0, 0, 0),
|
|
|
+ )
|
|
|
+ font_sub = ImageFont.truetype(r"resources\ttf\puhui\Light.ttf", 24) # 设计理念
|
|
|
+ pp_bg.get_text_image_advanced(
|
|
|
+ value=(114, 311),
|
|
|
+ font=font_sub,
|
|
|
+ text=subTitle,
|
|
|
+ align="left",
|
|
|
+ # anchor="ls",
|
|
|
+ spacing=5,
|
|
|
+ fill=(60, 40, 29),
|
|
|
+ return_mode="image",
|
|
|
+ margins=(0, 0, 0, 0),
|
|
|
+ )
|
|
|
+ # return PictureProcessing(image_path)
|
|
|
+ detailed_images.append(pp_bg)
|
|
|
+ return self.pp_pic_subsection(PictureProcessing(im=self.add_pic(detailed_images)))
|
|
|
|
|
|
def deal_pic_20(self):
|
|
|
detailed_images = []
|