import sys
from PIL import Image

in_path, bg_path, out_path = sys.argv[1:]

person = Image.open(in_path).convert("RGBA")
bg = Image.open(bg_path).convert("RGBA").resize(person.size)
combined = Image.alpha_composite(bg, person)
combined.save(out_path)
