TileStache.PixelEffects module

Different effects that can be applied to tiles.

Options are:

  • blackwhite:

    “effect”: {

    “name”: “blackwhite”

    }

  • greyscale:

    “effect”: {

    “name”: “greyscale”

    }

  • desaturate: Has an optional parameter “factor” that defines the saturation of the image. Defaults to 0.85.

    “effect”: {

    “name”: “desaturate”, “factor”: 0.85

    }

  • pixelate: Has an optional parameter “reduction” that defines how pixelated the image will be (size of pixel). Defaults to 5.

    “effect”: {

    “name”: “pixelate”, “factor”: 5

    }

  • halftone:

    “effect”: {

    “name”: “halftone”

    }

  • blur: Has an optional parameter “radius” that defines the blurriness of an image. Larger radius means more blurry. Defaults to 5.

    “effect”: {

    “name”: “blur”, “radius”: 5

    }

class TileStache.PixelEffects.Blackwhite

Bases: TileStache.PixelEffects.PixelEffect

Returns a black and white version of the original image.

apply_effect(image)
class TileStache.PixelEffects.Blur(radius=5)

Bases: TileStache.PixelEffects.PixelEffect

Returns a blurred version of the original image. radius defines the blurriness of an image. Larger radius means more blurry.

apply_effect(image)
class TileStache.PixelEffects.Desaturate(factor=0.85)

Bases: TileStache.PixelEffects.PixelEffect

Returns a desaturated version of the original image. factor is a number between 0 and 1, where 1 results in a greyscale image (no color), and 0 results in the original image.

apply_effect(image)
class TileStache.PixelEffects.Greyscale

Bases: TileStache.PixelEffects.PixelEffect

Returns a grescale version of the original image.

apply_effect(image)
class TileStache.PixelEffects.Halftone

Bases: TileStache.PixelEffects.PixelEffect

Returns a halftone version of the original image.

apply_effect(image)
class TileStache.PixelEffects.PixelEffect

Base class for all pixel effects. Subclasses must implement method apply_effect.

apply(image)
apply_effect(image)
class TileStache.PixelEffects.Pixelate(reduction=5)

Bases: TileStache.PixelEffects.PixelEffect

Returns a pixelated version of the original image. reduction defines how pixelated the image will be (size of pixels).

apply_effect(image)
TileStache.PixelEffects.put_original_alpha(original_image, new_image)

Put alpha channel of original image (if any) in the new image.