This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)


gives the subimage of image spanned by the specified points.
adds a margin of size r back to the resulting image.
  • ImageTrim assumes the standard image coordinate system where runs from 0 to image width and runs from 0 to image height. Position corresponds to the bottom-left corner of the image.
  • If fewer elements exist than are requested, ImageTrim will just return the elements that are present.
  • By setting a Padding option, pixels outside the original image can also be included.
  • ImageTrim takes a DataRange option that specifies the range of pixels in the input image. The default setting is DataRange. See the reference page for ImageValue for all possible settings.
  • ImageTrim specifies different horizontal and vertical margins.
Trim an image:
Trim an image:
Click for copyable input
Extract a single-pixel image:
Remove 20% of an image from each side:
Trim areas that contain no keypoints:
New in 8