From 5a958114339e5730192ae06148b4bf0ea425af5b Mon Sep 17 00:00:00 2001 From: dongchangxi <458593490@qq.com> Date: Sun, 22 Jun 2025 01:57:57 +0800 Subject: [PATCH] v3 --- apps/auto_convert3d_new.py | 4 ++-- apps/white_purification_v3.py | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/apps/auto_convert3d_new.py b/apps/auto_convert3d_new.py index 3e35f47..77987b0 100644 --- a/apps/auto_convert3d_new.py +++ b/apps/auto_convert3d_new.py @@ -3,7 +3,7 @@ import os, oss2, time, redis, requests, shutil, sys, subprocess, json, platform from PIL import Image, ImageDraw, ImageFont from retrying import retry import atexit,platform -import white_purification_v2,white_purification +import white_purification_v3,white_purification if platform.system() == 'Windows': sys.path.append('e:\\libs\\') import common @@ -152,7 +152,7 @@ def team_check(r): imagePath = os.path.join(workdir, 'print', pid,pid+"Tex1.jpg") print("开始处理白色提纯") #white_purification.white_purification_utils(imagePath) - os.system(f'python D:\\make2\\apps\white_purification_v2.py -i {imagePath}') + os.system(f'python D:\\make2\\apps\white_purification_v3.py -i {imagePath}') print("贴图文件白色提纯完成",imagePath) #提纯完重新上传提纯图片 diff --git a/apps/white_purification_v3.py b/apps/white_purification_v3.py index 7732916..960ef8c 100644 --- a/apps/white_purification_v3.py +++ b/apps/white_purification_v3.py @@ -124,13 +124,17 @@ def correct_texture_image(input_path,image_result_dir,output_path): } image_cache_dir= os.path.join(image_result_dir,"cache") os.makedirs(image_cache_dir, exist_ok=True) - image_light_down_fix_up_path = remove_gray_and_sharpening(input_path, image_cache_dir) + out_put_path = os.path.join(image_cache_dir, image_name) + shadow_up_path = out_put_path.replace(".jpg", "_shadow_up.jpg") + photoshop_actions_emulation(input_path, shadow_up_path) + image_light_down_fix_up_path = remove_gray_and_sharpening(shadow_up_path, image_cache_dir) output_light_up_path = image_light_down_fix_up_path.replace(".jpg", "_light_down.jpg") process_image(image_light_down_fix_up_path, output_light_up_path, **params) output_result_image_path=correct_light_again_hsv(output_light_up_path) shutil.copy(output_result_image_path,output_path) time.sleep(1) try: + os.remove(shadow_up_path) os.remove(image_light_down_fix_up_path) os.remove(output_light_up_path) os.remove(output_result_image_path) @@ -153,5 +157,4 @@ if __name__ == "__main__": print(f"处理成功,耗时 {total_time} 秒,") """ 1、暗部提亮->白色提纯(220)->高光压暗->二次亮度调整 - """ - + """ \ No newline at end of file