#NEWLINE# @ Image . operation #NEWLINE# def save_as_jpeg( self , f , quality = 85 ) : #NEWLINE# #INDENT# if ( self . image . mode in [ '1' , 'P' ] ) : #NEWLINE# #INDENT# image = self . image . convert ( 'RGB' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# image = self . image #NEWLINE# #UNINDENT# image . save ( f , 'JPEG' , quality = quality ) #NEWLINE# return JPEGImageFile ( f )