feat design 无色模式
fix
This commit is contained in:
@@ -14,11 +14,18 @@ class Color:
|
||||
|
||||
def __call__(self, result):
|
||||
dim_image_h, dim_image_w = result['image'].shape[0:2]
|
||||
# 渐变色
|
||||
if "gradient" in result.keys() and result['gradient'] != "":
|
||||
bucket_name = result['gradient'].split('/')[0]
|
||||
object_name = result['gradient'][result['gradient'].find('/') + 1:]
|
||||
pattern = self.get_gradient(bucket_name=bucket_name, object_name=object_name)
|
||||
resize_pattern = cv2.resize(pattern, (dim_image_w, dim_image_h), interpolation=cv2.INTER_AREA)
|
||||
# 无色
|
||||
elif "color" not in result.keys() or result['color'] == "":
|
||||
result['final_image'] = result['pattern_image'] = result['single_image'] = result['image']
|
||||
result['alpha'] = 100 / 255.0
|
||||
return result
|
||||
# 正常颜色
|
||||
else:
|
||||
pattern = self.get_pattern(result['color'])
|
||||
resize_pattern = cv2.resize(pattern, (dim_image_w, dim_image_h), interpolation=cv2.INTER_AREA)
|
||||
|
||||
Reference in New Issue
Block a user