|
SOLUTIONS
|
BUILT-IN MATHEMATICA SYMBOL
ImagePad[image, m]
pads image on all sides with m background pixels.
ImagePad[image, m, padding]
pads image on all sides using the value or method specified by padding.
ImagePad[image, {{left, right}, {bottom, top}}, ...]
pads image with the specified numbers of pixels on each side.
ImagePad[image, {{left, right}, {front, back}, {bottom, top}}, ...]
pads a 3D image with specified numbers of pixels.
Details and OptionsDetails and Options
- The following forms of padding can be specified:
-
z an intensity value color a color (GrayLevel, RGBColor, etc.) {c1,c2,...} list of channel values Automatic automatic choice based on the boundary "Fixed" repetitions of the pixels on each boundary "Periodic" cyclic repetitions of the complete image "Reflected" reflections of the image in the boundary "Reversed" reversals of the complete image - The padding value
indicates that the rectangles of pixels added at each corner should be copies of the pixels at the corners of the original image.
indicates that the outermost layer of pixels in the image should be repeated as the innermost layer of pixels in the padding.
specifies that these pixels should not be repeated. - ImagePad[image, ...] typically gives an image that has the same type as image. Padding a binary image with arbitrary intensity or color pixels typically returns an image of type
. - ImagePad[image, -m] removes m pixels from each side of image.
ExamplesExamplesopen allclose all
Basic Examples (4)Basic Examples (4)
Pad an image with 2 rows of yellow pixels:
| In[1]:= |
| Out[1]= | ![]() |
Pad with more rows, automatically determining the border color:
| In[2]:= |
| Out[2]= | ![]() |
Pad by reflecting the rows and columns at the borders:
| In[1]:= |
| Out[1]= | ![]() |
Pad an image by replicating rows and columns at the borders:
| In[1]:= |
| Out[1]= | ![]() |
Pad by periodically repeating rows and columns:
| In[1]:= |
| Out[1]= | ![]() |
New in 7 | Last modified in 9
Mathematica 9 is now available!
New to Mathematica?
Find your learning path »
Have a question?
Ask support »







