Python: Image resizing: keep proportion - add white background
问题 I would like to create a Python script to resize images, but not changing its proportions, just by adding a white background (So, a : 500*700 px image would transform to a 700*700 px image by adding 100 px of a white band on each side) The three image types I use are .PNG, .JPG and .GIF . I am not even sure it is possible for Gifs, PNG and JPG would already be awesome. In my case, they have to be squares. But if any of you manage to do it for adaptable to any proportion, it would benefit the