Mathematica > Data Manipulation > Image Processing & Analysis > Basic Image Manipulation > ImageTrim >

ImageTrim

ImageTrim
gives the subimage of image spanned by the specified points.
ImageTrim
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:
In[1]:=
Click for copyable input
Out[1]=
Extract a single-pixel image:
Remove 20% of an image from each side:
Trim areas that contain no keypoints:
New in 8
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team
Format:   HTML  |  CDF