Пример #1
0
def execute( width, height, data ):
    """
    Converts an image to greyscale.
    
    :Parameters:
        width : int
            The width of the image being converted
        height : int
            The height of the image being converted
        data : string
            A string containing the data for the image
    
    :rtype: tuple
    :returns: a tuple containing a width, height, and data as a binary string.
    """
    return toGrey( width, height, data )
Пример #2
0
def execute( width, height, data ):
    """
    Changes an image to greyscale and inverts the colors so as to make it
    appear more like an x-ray photo.
        
    :Parameters:
        width : int
            The width of the image being converted
        height : int
            The height of the image being converted
        data : string
            A string containing the data for the image
    
    :rtype: tuple
    :returns: a tuple containing a width, height, and data as a binary string.
    """
    return invert( *toGrey( width, height, data ) )
Пример #3
0
def execute( width, height, data ):
    """
    Converts the colors in an image to resemble a sepia tone photograph.
    
    :Parameters:
        width : int
            The width of the image being converted
        height : int
            The height of the image being converted
        data : string
            A string containing the data for the image
    
    :rtype: tuple
    :returns: a tuple containing a width, height, and data as a binary string.
    """
    pass1 = toGrey( width, height, data )[ 2 ]
    pass2 = channelBrightness( width, height, pass1, ( 0, -18, -35 ) )[ 2 ]
    # now adjust the gamma
    return gamma( width, height, pass2, brightness=0, contrast=1.1, gamma=0.8 )