detail_huilima5.py 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535
  1. """
  2. 步骤:
  3. 1、整理需要处理的款号图-输出款号图文件夹
  4. 2、整理所有相关的图片作为素材图
  5. 3、按要求进行拼接
  6. """
  7. import os
  8. from PIL import ImageFont
  9. import sys
  10. import settings
  11. # from module.view_control.generate_goods_no_detail_pic.detail_generate_base import DetailBase
  12. # from module.view_control.generate_goods_no_detail_pic.pic_deal import PictureProcessing
  13. is_test_plugins = False
  14. try:
  15. is_test_plugins = settings.is_test_plugins
  16. except:
  17. is_test_plugins = False
  18. if is_test_plugins:
  19. from custom_plugins.plugins_mode.detail_generate_base import DetailBase
  20. from custom_plugins.plugins_mode.pic_deal import PictureProcessing
  21. else:
  22. from plugins_mode.detail_generate_base import DetailBase
  23. from plugins_mode.pic_deal import PictureProcessing
  24. plugins_name = "详情模板"
  25. company_name_list = ["全部"]
  26. template_name = "huilima-5"
  27. # 乐福鞋 详情页
  28. class DetailPicGet(DetailBase):
  29. need_view = ["俯视", "侧视", "后跟", "鞋底", "内里"]
  30. root = r"{}\resources\detail_temp\huilima\5".format(os.getcwd())
  31. def __init__(
  32. self,
  33. goods_no,
  34. goods_no_value: dict,
  35. out_put_dir,
  36. windows=None,
  37. test=False,
  38. excel_data=None,
  39. assigned_page_list=None,
  40. output_queue=None,
  41. **kwargs
  42. ):
  43. super().__init__(
  44. goods_no,
  45. goods_no_value,
  46. out_put_dir,
  47. windows=windows,
  48. excel_data=excel_data,
  49. assigned_page_list=assigned_page_list,
  50. output_queue=output_queue,
  51. )
  52. self.template_name = template_name
  53. self.root = r"{}\resources\detail_temp\huilima\5".format(os.getcwd())
  54. print("run huilima-1 ")
  55. self.base_bg_color = (255, 255, 255)
  56. self.deal_pic_func_list = [
  57. self.deal_pic_1,
  58. self.deal_pic_2,
  59. self.deal_pic_3,
  60. self.deal_pic_4,
  61. self.deal_pic_5,
  62. self.deal_pic_6,
  63. self.deal_pic_7,
  64. self.deal_pic_8,
  65. ]
  66. if test:
  67. self.run_test()
  68. else:
  69. self.run_all()
  70. def run_test(self):
  71. detailed_images = []
  72. detailed_images.append(self.deal_pic_1())
  73. detailed_images.append(self.deal_pic_2())
  74. detailed_images.append(self.deal_pic_3())
  75. detailed_images.append(self.deal_pic_4())
  76. detailed_images.append(self.deal_pic_5())
  77. detailed_images.append(self.deal_pic_6())
  78. detailed_images.append(self.deal_pic_7())
  79. detailed_images.append(self.deal_pic_8())
  80. img = self.add_pic(detailed_images)
  81. if img:
  82. self.create_folder(r"{}/{}".format(self.out_put_dir, template_name))
  83. img.save(
  84. r"{}/{}/{}.jpg".format(
  85. self.out_put_dir, template_name, self.goods_no, format="JPEG"
  86. )
  87. )
  88. img.show()
  89. #
  90. def deal_pic_1(self):
  91. detailed_images = []
  92. pp_bg_1 = PictureProcessing(r"{}\1.jpg".format(self.root), 1600)
  93. font_main = ImageFont.truetype(r"resources\ttf\puhui\Bold.ttf", 160)
  94. font_sub = ImageFont.truetype(r"resources\ttf\puhui\Medium.ttf", 50)
  95. main_text = self.get_text_value("标题")
  96. sub_text = self.get_text_value("副标题")
  97. _pp = PictureProcessing().get_text_image_advanced(
  98. font=font_main,
  99. text=main_text,
  100. fill=(0, 0, 0),
  101. spacing=20,
  102. return_mode="min_image",
  103. )
  104. _pp_sub = PictureProcessing().get_text_image_advanced(
  105. font=font_sub,
  106. text=sub_text,
  107. fill=(0, 0, 0),
  108. return_mode="min_image",
  109. )
  110. pp_bg_1 = pp_bg_1.paste_img(top_img=_pp, value=(0, 232), base="cs")
  111. pp_bg_1 = pp_bg_1.paste_img(top_img=_pp_sub, value=(0, 446), base="cs")
  112. goods_art_no_list = list(self.data.keys())
  113. pp_jpg_1_list = []
  114. pp_png_1_list = []
  115. pp_jpg, pp_png = self.image_one_pic(
  116. return_orign=True,
  117. goods_art_no=goods_art_no_list[0],
  118. name="俯视",
  119. )
  120. pp_jpg_1_list.append(pp_jpg)
  121. pp_jpg_1_list.append(pp_jpg)
  122. pp_png_1_list.append(pp_png)
  123. pp_png_1_list.append(pp_png)
  124. x, y = 0, 0
  125. pp_bg_jpg = PictureProcessing("RGB", (1600, 1600), (255, 255, 255))
  126. _resize_value = (
  127. pp_bg_1.width if len(pp_jpg_1_list) == 1 else pp_bg_1.width - 300
  128. )
  129. for index, pp_jpg in enumerate(pp_jpg_1_list):
  130. pp_jpg = pp_jpg.resize(value=_resize_value + 100 * index)
  131. pp_bg_jpg = pp_bg_jpg.to_overlay_pic_advance(top_img=pp_jpg, value=(x, y))
  132. x += 180
  133. y += 60
  134. x, y = 0, 0
  135. pp_bg_png = PictureProcessing("RGBA", (1600, 1600), (255, 255, 255, 0))
  136. for index, pp_png in enumerate(pp_png_1_list):
  137. pp_png = pp_png.resize(value=_resize_value + 100 * index)
  138. pp_bg_png = pp_bg_png.paste_img(top_img=pp_png, value=(x, y))
  139. x += 180
  140. y += 60
  141. min_bbox = pp_bg_png.getbbox()
  142. min_bbox = PictureProcessing().expand_bbox(min_bbox)
  143. pp_bg_jpg = pp_bg_jpg.crop(bbox=min_bbox)
  144. pp_bg_png = pp_bg_png.crop(bbox=min_bbox)
  145. pp_bg_1 = pp_bg_1.to_overlay_pic_advance(
  146. top_img=pp_bg_jpg, top_png_img=pp_bg_png, base="cc"
  147. )
  148. detailed_images.append(pp_bg_1)
  149. # detailed_images.append(pp_bg_2)
  150. return PictureProcessing(im=self.add_pic(detailed_images))
  151. # 展示基础信息
  152. def deal_pic_2(self):
  153. detailed_images = []
  154. pp_bg_2 = PictureProcessing(r"{}\2.jpg".format(self.root))
  155. font_1 = ImageFont.truetype(r"resources\ttf\puhui\Bold.ttf", 130)
  156. font_desc = ImageFont.truetype(r"resources\ttf\puhui\Regular.ttf", 48)
  157. text = self.get_text_value("设计理念-标题")
  158. text_desc = self.get_text_value("设计理念")
  159. _pp = PictureProcessing().get_text_image_advanced(
  160. font=font_1,
  161. text=text,
  162. fill=(0, 0, 0),
  163. return_mode="min_image",
  164. )
  165. _pp_desc = PictureProcessing().get_text_image_advanced(
  166. font=font_desc,
  167. text=text_desc,
  168. fill=(0, 0, 0),
  169. spacing=30,
  170. align="center",
  171. return_mode="min_image",
  172. )
  173. pp_bg_2 = pp_bg_2.paste_img(top_img=_pp, value=(0, 212), base="nc")
  174. pp_bg_2 = pp_bg_2.paste_img(top_img=_pp_desc, value=(0, 533), base="nc")
  175. detailed_images.append(pp_bg_2)
  176. return PictureProcessing(im=self.add_pic(detailed_images))
  177. # 颜色展示
  178. def deal_pic_3(self):
  179. detailed_images = []
  180. pp_bg = PictureProcessing(r"{}\3.jpg".format(self.root))
  181. font_color = ImageFont.truetype(
  182. r"resources\ttf\puhui\Medium.ttf", 34
  183. ) # 颜色名称
  184. color_pic_list_1 = []
  185. for goods_art_no_dict in self.goods_no_value["货号资料"]:
  186. color_name = goods_art_no_dict["颜色名称"]
  187. goods_art_no = goods_art_no_dict["货号"]
  188. pp_jpg = self.get_overlay_pic_from_dict(
  189. goods_art_no=goods_art_no,
  190. color_name="侧视",
  191. bg_color=self.base_bg_color,
  192. )
  193. pp_jpg = pp_jpg.resize(value=pp_bg.width / 2)
  194. pp_jpg = pp_jpg.paste_img_invert(
  195. top_img=PictureProcessing(
  196. "RGBA", (pp_jpg.width, pp_jpg.height + 70), (255, 255, 255, 0)
  197. ),
  198. base="nw",
  199. )
  200. text_image = PictureProcessing().get_text_image_advanced(
  201. font=font_color,
  202. text="{}".format(color_name),
  203. fill=(0, 0, 0),
  204. return_mode="min_image",
  205. )
  206. pp_jpg = pp_jpg.paste_img(top_img=text_image, base="sc", value=(0, 10))
  207. color_pic_list_1.append(pp_jpg)
  208. # 颜色列表进行等分展示
  209. all_color_pp = PictureProcessing().horizontal_distribution(
  210. color_pic_list_1,
  211. bg_width=pp_bg.width - 100,
  212. line_spacing=10,
  213. number_per_row=2,
  214. )
  215. pp_bg.paste_img(top_img=all_color_pp, base="cc", value=(0, -100))
  216. font_category = ImageFont.truetype(r"resources\ttf\puhui\Regular.ttf", 50)
  217. text_xiemian = self.get_text_value("鞋面")
  218. text_xiedi = self.get_text_value("鞋底")
  219. text_neili = self.get_text_value("内里")
  220. text_xiedian = self.get_text_value("鞋垫")
  221. pp_text_xiemian = PictureProcessing().get_text_image_advanced(
  222. font=font_category,
  223. text=text_xiemian,
  224. fill=(0, 0, 0),
  225. return_mode="min_image",
  226. )
  227. pp_text_xiedian = PictureProcessing().get_text_image_advanced(
  228. font=font_category,
  229. text=text_xiedian,
  230. fill=(0, 0, 0),
  231. return_mode="min_image",
  232. )
  233. pp_text_xiedi = PictureProcessing().get_text_image_advanced(
  234. font=font_category,
  235. text=text_xiedi,
  236. fill=(0, 0, 0),
  237. return_mode="min_image",
  238. )
  239. pp_text_neili = PictureProcessing().get_text_image_advanced(
  240. font=font_category,
  241. text=text_neili,
  242. fill=(0, 0, 0),
  243. return_mode="min_image",
  244. )
  245. pp_bg = pp_bg.paste_img(top_img=pp_text_xiemian, value=(416, 960), base="nw")
  246. pp_bg = pp_bg.paste_img(top_img=pp_text_xiedian, value=(416, 1144), base="nw")
  247. pp_bg = pp_bg.paste_img(top_img=pp_text_neili, value=(1157, 960), base="nw")
  248. pp_bg = pp_bg.paste_img(top_img=pp_text_xiedi, value=(1157, 1144), base="nw")
  249. detailed_images.append(pp_bg)
  250. return PictureProcessing(im=self.add_pic(detailed_images))
  251. # 展示细节图
  252. def deal_pic_4(self):
  253. detailed_images = []
  254. bg_image = PictureProcessing(r"{}\4.jpg".format(self.root))
  255. text_fill = (255, 255, 255)
  256. font_title = ImageFont.truetype(r"resources\ttf\puhui\Bold.ttf", 150)
  257. font_sub = ImageFont.truetype(r"resources\ttf\puhui\Regular.ttf", 50)
  258. text_title = self.get_text_value("细节标题-1")
  259. text_sub_title = self.get_text_value("细节副标题-1")
  260. pp_text_title = PictureProcessing().get_text_image_advanced(
  261. font=font_title,
  262. text=text_title,
  263. fill=text_fill,
  264. return_mode="min_image",
  265. )
  266. pp_text_sub_title = PictureProcessing().get_text_image_advanced(
  267. font=font_sub,
  268. text=text_sub_title,
  269. fill=text_fill,
  270. return_mode="min_image",
  271. )
  272. bg_image.paste_img(top_img=pp_text_title, base="en", value=(108, 258))
  273. bg_image.paste_img(top_img=pp_text_sub_title, base="en", value=(108, 578))
  274. goods_art_no_list = list(self.data.keys())
  275. _, pp_png = self.image_one_pic(
  276. return_orign=True,
  277. goods_art_no=goods_art_no_list[0],
  278. name="俯视",
  279. )
  280. pp_png = pp_png.resize(value=bg_image.width * 2)
  281. bg_image.paste_img(top_img=pp_png, base="cs", value=(-pp_png.width / 4, -200))
  282. detailed_images.append(bg_image)
  283. return PictureProcessing(im=self.add_pic(detailed_images))
  284. # 场景图--产品展示
  285. def deal_pic_5(self):
  286. detailed_images = []
  287. bg_image = PictureProcessing(r"{}\5.jpg".format(self.root))
  288. text_fill = (255, 255, 255)
  289. font_title = ImageFont.truetype(r"resources\ttf\puhui\Bold.ttf", 150)
  290. font_sub = ImageFont.truetype(r"resources\ttf\puhui\Regular.ttf", 50)
  291. text_title = self.get_text_value("细节标题-2")
  292. text_sub_title = self.get_text_value("细节副标题-2")
  293. pp_text_title = PictureProcessing().get_text_image_advanced(
  294. font=font_title,
  295. text=text_title,
  296. fill=text_fill,
  297. return_mode="min_image",
  298. )
  299. pp_text_sub_title = PictureProcessing().get_text_image_advanced(
  300. font=font_sub,
  301. text=text_sub_title,
  302. fill=text_fill,
  303. return_mode="min_image",
  304. )
  305. bg_image.paste_img(top_img=pp_text_title, base="nw", value=(115, 369))
  306. bg_image.paste_img(top_img=pp_text_sub_title, base="nw", value=(115, 686))
  307. goods_art_no_list = list(self.data.keys())
  308. _, pp_png = self.image_one_pic(
  309. return_orign=True,
  310. goods_art_no=goods_art_no_list[0],
  311. name="俯视",
  312. )
  313. pp_png = pp_png.resize(value=bg_image.width * 2)
  314. bg_image.paste_img(top_img=pp_png, base="cs", value=(pp_png.width / 4, 0))
  315. detailed_images.append(bg_image)
  316. return PictureProcessing(im=self.add_pic(detailed_images))
  317. # 场景图--产品展示
  318. def deal_pic_6(self):
  319. detailed_images = []
  320. bg_image = PictureProcessing(r"{}\6.jpg".format(self.root))
  321. text_fill = (255, 255, 255)
  322. font_title = ImageFont.truetype(r"resources\ttf\puhui\Bold.ttf", 150)
  323. font_sub = ImageFont.truetype(r"resources\ttf\puhui\Regular.ttf", 50)
  324. text_title = self.get_text_value("细节标题-3")
  325. text_sub_title = self.get_text_value("细节副标题-3")
  326. pp_text_title = PictureProcessing().get_text_image_advanced(
  327. font=font_title,
  328. text=text_title,
  329. fill=text_fill,
  330. return_mode="min_image",
  331. )
  332. pp_text_sub_title = PictureProcessing().get_text_image_advanced(
  333. font=font_sub,
  334. text=text_sub_title,
  335. fill=text_fill,
  336. return_mode="min_image",
  337. )
  338. bg_image.paste_img(top_img=pp_text_title, base="en", value=(108, 158))
  339. bg_image.paste_img(top_img=pp_text_sub_title, base="en", value=(108, 578))
  340. goods_art_no_list = list(self.data.keys())
  341. _, pp_png = self.image_one_pic(
  342. return_orign=True,
  343. goods_art_no=goods_art_no_list[0],
  344. name="侧视",
  345. )
  346. pp_png = pp_png.resize(value=bg_image.width * 2)
  347. bg_image.paste_img(top_img=pp_png, base="cs", value=(-pp_png.width / 3.5, 100))
  348. detailed_images.append(bg_image)
  349. return PictureProcessing(im=self.add_pic(detailed_images))
  350. # 场景图--产品展示
  351. def deal_pic_7(self):
  352. detailed_images = []
  353. top_image = PictureProcessing(r"{}\7.jpg".format(self.root))
  354. text_fill = (0, 0, 0)
  355. font_title = ImageFont.truetype(r"resources\ttf\puhui\Regular.ttf", 60)
  356. font_sub = ImageFont.truetype(r"resources\ttf\puhui\Regular.ttf", 40)
  357. detailed_images.append(top_image)
  358. goods_art_no_list = list(self.data.keys())
  359. for goods_info in goods_art_no_list:
  360. pp_jpg_1_list = []
  361. pp_png_1_list = []
  362. for goods_item in goods_art_no_list:
  363. pp_jpg, pp_png = self.image_one_pic(
  364. return_orign=True,
  365. goods_art_no=goods_item,
  366. name="俯视",
  367. )
  368. pp_jpg_1_list.append(pp_jpg)
  369. pp_png_1_list.append(pp_png)
  370. x, y = 0, 0
  371. pp_bg_jpg = PictureProcessing("RGB", (1600, 1600), (255, 255, 255))
  372. _resize_value = (
  373. top_image.width if len(pp_jpg_1_list) == 1 else top_image.width - 300
  374. )
  375. for index, pp_jpg in enumerate(pp_jpg_1_list):
  376. pp_jpg = pp_jpg.resize(value=_resize_value + 100 * index)
  377. pp_bg_jpg = pp_bg_jpg.to_overlay_pic_advance(
  378. top_img=pp_jpg, value=(x, y)
  379. )
  380. x += 180
  381. y += 60
  382. x, y = 0, 0
  383. pp_bg_png = PictureProcessing("RGBA", (1600, 1600), (255, 255, 255, 0))
  384. for index, pp_png in enumerate(pp_png_1_list):
  385. pp_png = pp_png.resize(value=_resize_value + 100 * index)
  386. pp_bg_png = pp_bg_png.paste_img(top_img=pp_png, value=(x, y))
  387. x += 180
  388. y += 60
  389. min_bbox = pp_bg_png.getbbox()
  390. min_bbox = PictureProcessing().expand_bbox(min_bbox)
  391. pp_bg_jpg = pp_bg_jpg.crop(bbox=min_bbox)
  392. pp_bg_png = pp_bg_png.crop(bbox=min_bbox)
  393. pp_bg_1 = PictureProcessing(
  394. "RGB", (top_image.width, pp_bg_jpg.height), (255, 255, 255)
  395. )
  396. pp_bg_1 = pp_bg_1.to_overlay_pic_advance(
  397. top_img=pp_bg_jpg, top_png_img=pp_bg_png, base="cc"
  398. )
  399. pp_text_title = PictureProcessing().get_text_image_advanced(
  400. font=font_title,
  401. text="45°侧视/SIDE",
  402. fill=text_fill,
  403. return_mode="min_image",
  404. )
  405. pp_bg_1.paste_img(top_img=pp_text_title, base="cs", value=(0, 0))
  406. color_pic_list_1 = []
  407. pp_jpg_ceshi, pp_png_ceshi = self.image_one_pic(
  408. return_orign=True,
  409. goods_art_no=goods_item,
  410. name="侧视",
  411. )
  412. pp_jpg_hougen, pp_png_hougen = self.image_one_pic(
  413. return_orign=True,
  414. goods_art_no=goods_item,
  415. name="后跟",
  416. )
  417. pp_jpg_neili, pp_png_neili = self.image_one_pic(
  418. return_orign=True,
  419. goods_art_no=goods_item,
  420. name="内里",
  421. )
  422. pp_jpg_xiedi, pp_png_xiedi = self.image_one_pic(
  423. return_orign=True,
  424. goods_art_no=goods_item,
  425. name="鞋底",
  426. )
  427. pp_png_ceshi = pp_png_ceshi.resize(value=pp_bg_jpg.width / 3)
  428. text_image = PictureProcessing().get_text_image_advanced(
  429. font=font_sub,
  430. text="180°侧面/SIDE",
  431. fill=(0, 0, 0),
  432. return_mode="min_image",
  433. )
  434. backImage = PictureProcessing(
  435. "RGB", (top_image.width / 2, 400), (255, 255, 255)
  436. )
  437. backImage.paste_img(top_img=text_image, base="cs", value=(0, 0))
  438. backImage.paste_img(top_img=pp_png_ceshi, base="cs", value=(0, 30))
  439. color_pic_list_1.append(backImage)
  440. pp_png_hougen = pp_png_hougen.resize(value=pp_bg_jpg.width / 4.5)
  441. text_image = PictureProcessing().get_text_image_advanced(
  442. font=font_sub,
  443. text="背面/BACK",
  444. fill=(0, 0, 0),
  445. return_mode="min_image",
  446. )
  447. backImage = PictureProcessing(
  448. "RGB", (top_image.width / 2, 400), (255, 255, 255)
  449. )
  450. backImage.paste_img(top_img=text_image, base="cs", value=(0, 0))
  451. backImage.paste_img(top_img=pp_png_hougen, base="cs", value=(0, 30))
  452. color_pic_list_1.append(backImage)
  453. pp_png_neili = pp_png_neili.resize(value=pp_bg_jpg.width / 3)
  454. text_image = PictureProcessing().get_text_image_advanced(
  455. font=font_sub,
  456. text="鞋面/VAMP",
  457. fill=(0, 0, 0),
  458. return_mode="min_image",
  459. )
  460. backImage = PictureProcessing(
  461. "RGB", (top_image.width / 2, 400), (255, 255, 255)
  462. )
  463. backImage.paste_img(top_img=text_image, base="cs", value=(-10, 0))
  464. backImage.paste_img(top_img=pp_png_neili, base="cs", value=(-10, 30))
  465. color_pic_list_1.append(backImage)
  466. pp_png_xiedi = pp_png_xiedi.resize(value=pp_bg_jpg.width / 3)
  467. text_image = PictureProcessing().get_text_image_advanced(
  468. font=font_sub,
  469. text="鞋底/BOTTOM",
  470. fill=(0, 0, 0),
  471. return_mode="min_image",
  472. )
  473. backImage = PictureProcessing(
  474. "RGB", (top_image.width / 2, 400), (255, 255, 255)
  475. )
  476. backImage.paste_img(top_img=text_image, base="cs", value=(0, 0))
  477. backImage.paste_img(top_img=pp_png_xiedi, base="cs", value=(0, 30))
  478. color_pic_list_1.append(backImage)
  479. all_color_pp = PictureProcessing(
  480. "RGB", (top_image.width, 1600), (255, 255, 255)
  481. ).horizontal_distribution(
  482. color_pic_list_1,
  483. bg_width=top_image.width,
  484. line_spacing=10,
  485. number_per_row=2,
  486. )
  487. detailed_images.append(pp_bg_1)
  488. detailed_images.append(all_color_pp)
  489. bottomImage = PictureProcessing(
  490. "RGB", (top_image.width, 200), (255, 255, 255)
  491. )
  492. detailed_images.append(bottomImage)
  493. return PictureProcessing(im=self.add_pic(detailed_images))
  494. # # 添加注意事项
  495. def deal_pic_8(self):
  496. detailed_images = []
  497. detailed_images.append(PictureProcessing(r"{}\10.jpg".format(self.root)))
  498. return PictureProcessing(im=self.add_pic(detailed_images))