예제 #1
0
파일: greyscale.py 프로젝트: mcgrew/pimp
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
파일: xRay.py 프로젝트: mcgrew/pimp
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
파일: sepia.py 프로젝트: mcgrew/pimp
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 )