Monty Python

Using Python to Remove Image Backgrounds

Jim Lawless
A couple of weeks ago, I saw a notification containing a simple Python script that would remove backgrounds from images. The sample source code was something like this: from rembg import remove from PIL import Image inp = Image.open('image.jpg') output = remove(inp) output.save('image.png') I tried it. The results were pretty impressive. Without providing any parameters to speak of, a number of images that I used to test the library were transformed into images highlighting a central person or object while rendering the background transparent.