SyntaxFix
Write A Post
Hire A Developer
Questions
An easier way to do this is using crop from ImageOps. You can feed the number of pixels you want to crop from each side.
from PIL import ImageOps border = (0, 30, 0, 30) # left, up, right, bottom ImageOps.crop(img, border)