xt("2d").drawImage(img, 0, 0, img.width, img.height);
    };
    const input = document.createElement("input");
    input.type = "file";
    input.onchange = () => (img.src = URL.createObjectURL(input.files[0]));
    input.click();
  };
  $out.onclick = () => {
    const { width, height } = $in1;
    if (width !== $in2.width || height !== $in2.height)
      return alert("Input images size must be the same");
    const [bg1R, bg1G, bg1B] = $bg1.value.split(" ").map(Number);
    const [bg2R, bg2G, bg2B] = $bg