SyntaxFix
Write A Post
Hire A Developer
Questions
def trans_paste(bg_img,fg_img,box=(0,0)): fg_img_trans = Image.new("RGBA",bg_img.size) fg_img_trans.paste(fg_img,box,mask=fg_img) new_img = Image.alpha_composite(bg_img,fg_img_trans) return new_img