Use Trim to apply a rectangular crop that trims uniform areas from the edges of the image.

If you add the IMQuery transformation to a policy, use the im variable, and select Trim, you can use a query string to trim any image using this policy. See Syntax and Examples for the syntax for the query string parameter.