BorderDimensions
BorderDimensions[image] gives the pixel width of uniform borders of image in the form {{left,right},{bottom,top}}.
BorderDimensions[image,t] finds borders whose pixels vary by an amount less than t.
Please visit the official Wolfram Language Reference for more details and examples on core symbols.