Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(10)  |  Call(0)  |  Derive(8)  |  Import(2)

src/p/y/PyCAPTCHA-HEAD/Captcha/Visual/Backgrounds.py   PyCAPTCHA(Download)
#
 
from Captcha.Visual import Layer, Pictures
import random, os
import ImageDraw, Image
 
 
class SolidColor(Layer):
class Grid(Layer):
    """A grid of lines, with a given foreground color.
       The size is given in pixels. The background is transparent,
       so another layer (like SolidColor) should be put behind it.
       """
class TiledImage(Layer):
    """Pick a random image and a random offset, and tile the rendered image with it"""
    def __init__(self, imageFactory=Pictures.abstract):
        self.tileName = imageFactory.pick()
        self.offset = (random.uniform(0, 1),
class CroppedImage(Layer):
    """Pick a random image, cropped randomly. Source images should be larger than the CAPTCHA."""
    def __init__(self, imageFactory=Pictures.nature):
        self.imageName = imageFactory.pick()
        self.align = (random.uniform(0,1),

src/p/y/PyCAPTCHA-HEAD/Captcha/Visual/Distortions.py   PyCAPTCHA(Download)
#
 
from Captcha.Visual import Layer
import ImageDraw, Image
import random, math
 
 
class WigglyBlocks(Layer):
class WarpBase(Layer):
    """Abstract base class for image warping. Subclasses define a
       function that maps points in the output image to points in the input image.
       This warping engine runs a grid of points through this transform and uses
       PIL's mesh transform to warp the image.

src/p/y/PyCAPTCHA-HEAD/Captcha/Visual/Text.py   PyCAPTCHA(Download)
class TextLayer(Visual.Layer):
    """Represents a piece of text rendered within the image.
       Alignment is given such that (0,0) places the text in the
       top-left corner and (1,1) places it in the bottom-left.