How can I set the background of a transparent image to white, using PIL?
<p>I have a PNG image with transparent background and I want to resize it to another image, but with a white background instead of a transparent one. 
How can I do that with PIL?</p>

<p>Here is my code:</p>

<pre><code>basewidth = 200
img = Image.open("old.png")
wpercent = (basewidth/float(img.size[0]))
hsize = int((float(img.size[1]) * float(wpercent)))
img = img.resize((basewidth, hsize), PIL.Image.ANTIALIAS)hsize = int((float(img.size[1]) * float(wpercent)))
img.save("new.png")
</code></pre>