This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.

ImageCrop

 ImageCrop[image] crops image by removing borders of uniform color. ImageCropcrops image to pixel width w and pixel height h. ImageCropcrops image based on the size specification size. ImageCropcrops image by removing pixels from sides specified by spec.
• ImageCrop[image] effectively removes borders from image whose pixel value distribution is almost uniform.
• ImageCrop by default removes pixels symmetrically from image, or if w or h is larger than for image, it adds pixels symmetrically.
• The final image size specification size in ImageCrop can have the following forms:
 {w,h} particular width and height w width w; height based on aspect ratio {s} maximum width or height s {{wmax},{hmax}} width and height maximums {{wmin,wmax},{hmin,hmax}} width and height ranges
• The following special forms can be used for width or height:
 Full do no cropping in this dimension Automatic determine value from aspect ratio
• The cropping specification spec in ImageCrop can have the following forms:
 side crop on the specified side; center otherwise {side1,side2} crop on the specified sides {ax,ay} assign a fraction of cropping to each side
• Cropping fractions are between and . In the horizontal case, is equivalent to Left, to Right, and to Center. In the vertical case, is equivalent to Bottom, and to Top.
• The following options can be given:
 AspectRatio Automatic ratio of height to width for the final image Padding Black padding to use if necessary
 Automatic use the aspect ratio of the original image r use aspect ratio r
• An explicit setting for AspectRatio is only taken into account when either the height or width is not specified.
• If the final image specified by ImageCrop extends beyond image, then pixels are added according to the setting for Padding.
Automatically crop uniform borders:
Crop an image to 100 by 100 pixels:
Crop to a width of 100 pixels and a height of 50 pixels:
Crop at the left side, preserving the aspect ratio:
Crop at the left side only:
Crop at the left side and the bottom:
Padding is used if a size larger than the original size is specified:
Automatically crop uniform borders:
 Out[1]=

Crop an image to 100 by 100 pixels:
 Out[1]=

Crop to a width of 100 pixels and a height of 50 pixels:
 Out[1]=

Crop at the left side, preserving the aspect ratio:
 Out[1]=

Crop at the left side only:
 Out[1]=

Crop at the left side and the bottom:
 Out[1]=

Padding is used if a size larger than the original size is specified:
 Out[1]=
 Applications   (2)
Pad an image to a fixed size:
Letterbox a wide image into a 320×240 format:
New in 7