from PIL import Image
img = Image.open("img.jpg")
w5 = (img.size[0] // 100) * 5
h5 = (img.size[1] // 100) * 5
croped = img.crop(
(
w5,
h5,
img.size[0] - w5,
img.size[1] - h5
)
)
croped.save("croped.jpg")
from PIL import Image
from PIL import ImageOps
img = Image.open("img.jpg")
w5 = (img.size[0] // 100) * 5
croped = ImageOps.crop(img, w5)
croped.save("croped.jpg")