Trim whitespace using PIL
I don’t think there is anything built in to PIL that can do this. But I’ve modified your code so it will do it. It gets the border colour from the top left pixel, using getpixel, so you don’t need to pass the colour. Subtracts a scalar from the differenced image, this is a quick … Read more