ImageRotate

ImageRotate[image]
rotates image counterclockwise by 90°.

ImageRotate[image, side]
rotates image to make the top of the image be on the specified side.

ImageRotate[image, side1->side2]
rotates image to make be on .

ImageRotate[image, ]
rotates image counterclockwise by radians.

ImageRotate[image, side, size]
gives an image of the specified size.

Details and OptionsDetails and Options

  • Possible side specifications are: Top, Bottom, Left, Right.
  • ImageRotate[image, ...] rotates image about its center.
  • ImageRotate yields an Image object with pixel values corresponding to a rotated image.
  • ImageRotate[image, side] is equivalent to ImageRotate[image, Top->side].
  • ImageRotate takes a Background option to specify the color assumed for pixels outside the image. With Background->Transparent, ImageRotate pads with fully transparent black pixels.
  • By default, ImageRotate automatically chooses the most suitable resampling algorithm. An explicit algorithm can be specified by setting the Resampling option.
  • In ImageRotate[image, side, size], possible specifications for size include:
  • wwidth of the output image
    {w,h}width and height of the output image
    Automaticsmallest rectangle to enclose all of the rotated image
    Allsmallest square to accommodate the rotated image for any rotation angle
    Fulluse the dimensions of the input image

ExamplesExamplesopen allclose all

Basic Examples (4)Basic Examples (4)

Rotate an image counterclockwise by 90 degrees:

In[1]:=
Click for copyable input
Out[1]=

Rotate an image counterclockwise by 20 degrees:

In[1]:=
Click for copyable input
Out[1]=

Turn a photo to the right:

In[1]:=
Click for copyable input
Out[1]=

Turn the previous result so that the left side goes to the top:

In[2]:=
Click for copyable input
Out[2]=

Pad the result to include the entire rotated image:

In[1]:=
Click for copyable input
Out[1]=
New in 7 | Last modified in 8
New to Mathematica? Find your learning path »
Have a question? Ask support »