Can't paste image due to ValueError: bad transparency mask
<p>Creating a program to paste another image on top of another image. And when I paste a campaign logo that I made in Photoshop, And when I run the program, I get the error: </p>

<p><code>ValueError: bad transparency mask</code> </p>

<p>I tried converting the image from RGBA to RGB, and that did not work, here is the code:</p>

<pre><code>def test():
background = Image.open("photo.png")
logo = Image.open("66.png")

background_small = logo.resize(bg_size)
logo_small = logo.resize(logo_size)

background.paste(logo, (0, 600), logo)
background.show()

background.save('out.png')
</code></pre>

<p>Edit: I fixed the error using this stackoverflow post: <a href="https://stackoverflow.com/questions/9166400/convert-rgba-png-to-rgb-with-pil">Convert RGBA PNG to RGB with PIL</a></p>