
Transformation
==============

``mirror_horizontal``
---------------------

**mirror_horizontal** ()


:Operates on: ``Image`` [OneBit|GreyScale|Grey16|RGB|Float|Complex]
:Category: Transformation
:Defined in: transformation.py
:Author: Michael Droettboom, Karl MacMillan, and Christoph Dalitz


Flips the image across the horizontal (*x*) axis.

----------

**Example 1:** mirror_horizontal()

..  image:: images/RGB_generic.png
   :height: 129
   :width: 227

..  image:: images/mirror_horizontal_plugin_00.png
   :height: 129
   :width: 227



``mirror_vertical``
-------------------

**mirror_vertical** ()


:Operates on: ``Image`` [OneBit|GreyScale|Grey16|RGB|Float|Complex]
:Category: Transformation
:Defined in: transformation.py
:Author: Michael Droettboom, Karl MacMillan, and Christoph Dalitz


Flips the image across the vertical (*y*) axis.

----------

**Example 1:** mirror_vertical()

..  image:: images/RGB_generic.png
   :height: 129
   :width: 227

..  image:: images/mirror_vertical_plugin_00.png
   :height: 129
   :width: 227



``resize``
----------

``Image`` [OneBit|GreyScale|Grey16|RGB|Float|Complex] **resize** (``Dim`` *dim*, ``Choice`` [None|Linear|Spline] *interp_type*)


:Operates on: ``Image`` [OneBit|GreyScale|Grey16|RGB|Float|Complex]
:Returns: ``Image`` [OneBit|GreyScale|Grey16|RGB|Float|Complex]
:Category: Transformation
:Defined in: transformation.py
:Author: Michael Droettboom, Karl MacMillan, and Christoph Dalitz


Returns a resized copy of an image. In addition to size, the type
of interpolation can be specified, with a tradeoff between speed
and quality.

If you need to maintain the aspect ratio of the original image,
consider using scale_ instead.

*dim*
  The size of the resulting image.

*interp_type* [None|Linear|Spline]
  The type of interpolation used to resize the image.  Each option
  is progressively higher quality, yet slower.

.. _scale: #scale


``rotate``
----------

``Image`` [OneBit|GreyScale|Grey16|RGB|Float|Complex] **rotate** (float(-180.00, 180.00) *angle*, Pixel *bgcolor* = None, int(1, 3) *order* = 1)


:Operates on: ``Image`` [OneBit|GreyScale|Grey16|RGB|Float|Complex]
:Returns: ``Image`` [OneBit|GreyScale|Grey16|RGB|Float|Complex]
:Category: Transformation
:Defined in: transformation.py
:Author: Michael Droettboom (With code from VIGRA by Ullrich Köthe)


Rotates an image.

*angle*
  The angle of rotation (in degrees)

*bgcolor*
  The color to use for pixels outside of the original image bounds.
  When *bgcolor* is ``None``, white is used.

*order*
  The order of the spline used for interpolation.  Must be between 1 - 3.

----------

**Example 1:** rotate(32.0, (255, 255, 255), 3)

..  image:: images/RGB_generic.png
   :height: 129
   :width: 227

..  image:: images/rotate_plugin_00.png
   :height: 233
   :width: 265

**Example 2:** rotate(15.0, 0j, 3)

..  image:: images/GreyScale_generic.png
   :height: 67
   :width: 96

..  image:: images/rotate_plugin_01.png
   :height: 93
   :width: 114



``scale``
---------

``Image`` [OneBit|GreyScale|Grey16|RGB|Float|Complex] **scale** (float *scaling*, ``Choice`` [None|Linear|Spline] *interp_type*)


:Operates on: ``Image`` [OneBit|GreyScale|Grey16|RGB|Float|Complex]
:Returns: ``Image`` [OneBit|GreyScale|Grey16|RGB|Float|Complex]
:Category: Transformation
:Defined in: transformation.py
:Author: Michael Droettboom, Karl MacMillan, and Christoph Dalitz


Returns a scaled copy of the image. In addition to scale, the type
of interpolation can be specified, with a tradeoff between speed
and quality.

If you need to change the aspect ratio of the original image,
consider using resize_ instead.

*scale*
  A scaling factor.  Values greater than 1 will result in a larger image.
  Values less than 1 will result in a smaller image.

*interp_type* [None|Linear|Spline]
  The type of interpolation used to resize the image.  Each option is
  progressively higher quality, yet slower.

.. _resize: #resize

----------

**Example 1:** scale(0.5, 2)

..  image:: images/RGB_generic.png
   :height: 129
   :width: 227

..  image:: images/scale_plugin_00.png
   :height: 64
   :width: 113

**Example 2:** scale(2.0, 2)

..  image:: images/RGB_generic.png
   :height: 129
   :width: 227

..  image:: images/scale_plugin_01.png
   :height: 259
   :width: 455



``shear_column``
----------------

**shear_column** (int *column*, int *distance*)


:Operates on: ``Image`` [OneBit|GreyScale|Grey16|RGB|Float|Complex]
:Category: Transformation
:Defined in: transformation.py
:Author: Michael Droettboom, Karl MacMillan, and Christoph Dalitz


Shears a given column by a given amount.

*column*
  The column number to shear.

*distance*
  The number of pixels to move the column.  Positive values
  move the column downward.  Negative values move the column
  upward.

----------

**Example 1:** shear_column(50, 10)

..  image:: images/OneBit_generic.png
   :height: 99
   :width: 69

..  image:: images/shear_column_plugin_00.png
   :height: 99
   :width: 69



``shear_row``
-------------

**shear_row** (int *row*, int *distance*)


:Operates on: ``Image`` [OneBit|GreyScale|Grey16|RGB|Float|Complex]
:Category: Transformation
:Defined in: transformation.py
:Author: Michael Droettboom, Karl MacMillan, and Christoph Dalitz


Shears a given row by a given amount.

*row*
  The row number to shear.

*distance*
  The number of pixels to move the row.  Positive values
  move the row to the right.  Negative values move the row
  to the left.

----------

**Example 1:** shear_row(50, 10)

..  image:: images/OneBit_generic.png
   :height: 99
   :width: 69

..  image:: images/shear_row_plugin_00.png
   :height: 99
   :width: 69



