#NEWLINE# def _colorspace( self , image , colorspace ) : #NEWLINE# #INDENT# "\n        Sets the image's colorspace. This is typical 'RGB' or 'GRAY', but\n        may be other things, depending on your choice of Engine.\n\n        :param PIL.Image image: The image whose colorspace to adjust.\n        :param str colorspace: One of either 'RGB' or 'GRAY'.\n        :rtype: PIL.Image\n        :returns: The colorspace-adjusted image.\n        " #NEWLINE# if ( colorspace == 'RGB' ) : #NEWLINE# #INDENT# if ( image . mode == 'RGBA' ) : #NEWLINE# #INDENT# return image #NEWLINE# #UNINDENT# if ( ( image . mode == 'P' ) and ( 'transparency' in image . info ) ) : #NEWLINE# #INDENT# return image . convert ( 'RGBA' ) #NEWLINE# #UNINDENT# return image . convert ( 'RGB' ) #NEWLINE# #UNINDENT# if ( colorspace == 'GRAY' ) : #NEWLINE# #INDENT# return image . convert ( 'L' ) #NEWLINE# #UNINDENT# return image