MCPcopy Create free account
hub / github.com/Royalvice/DocDiff / set_opacity

Function set_opacity

utils/marker.py:72–81  ·  view source on GitHub ↗

设置水印透明度

(im, opacity)

Source from the content-addressed store, hash-verified

70
71
72def set_opacity(im, opacity):
73 """
74 设置水印透明度
75 """
76 assert 0 <= opacity <= 1
77
78 alpha = im.split()[3]
79 alpha = ImageEnhance.Brightness(alpha).enhance(opacity)
80 im.putalpha(alpha)
81 return im
82
83
84def crop_image(im):

Callers 1

gen_markFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected