Download: latest (1.8.0)

pymagery — python imagery


1.5.0 documentation / rot_180 plugin

This plugin rotates the image 180 degrees. Since rotation in a multiple of 90 degrees requires no interpolation this plugin is not susceptible to information loss. The following is an example:

The plugin prototype is:

def rot_180()

The dimensions of an image are unchanged since they are transposed twice (rows become columns then rows again).

The following example rotates an image by 180 degrees:

import pymagery i = pymagery.image('foo.ppm') i.rot_180()

Rotation by 90 degrees clockwise is identical to a rotation of 90 degrees counter-clockwise and a rotation by 90 degrees counter-clockwise is identical to a rotation of 90 degrees clockwise.

A note of interest is that a rotation of 180 degrees is identical to a horizontal flip followed by a vertical flip (that is, in fact, how this plugin is implemented).

Change Log