#NEWLINE# def save_image( self , path ) : #NEWLINE# #INDENT# ( width , height ) = self . size #NEWLINE# data = ( c_ubyte * ( ( width * height ) * 3 ) ) ( ) #NEWLINE# glReadBuffer ( GL_BACK ) #NEWLINE# glReadPixels ( 0 , 0 , width , height , GL_RGB , GL_UNSIGNED_BYTE , path ) #NEWLINE# im = Image . frombytes ( 'RGB' , ( width , height ) , data ) #NEWLINE# im = im . transpose ( Image . FLIP_TOP_BOTTOM ) #NEWLINE# im . save ( path )