#NEWLINE# def convert_to_grayscale( self , update_image = True , with_alpha = True ) : #NEWLINE# #INDENT# if ( ( 'A' in image . image . mode ) and with_alpha ) : #NEWLINE# #INDENT# image = self . image . convert ( 'LA' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# image = self . image . convert ( 'L' ) #NEWLINE# #UNINDENT# if update_image : #NEWLINE# #INDENT# self . image = image #NEWLINE# #UNINDENT# return image