def wxToPIL(wimg):
 from PIL import Image
 (w, h) = wimg.GetSize()
 d = wimg.GetData()
 pimg = Image.new('RGB', (w, h), color=1)
 pimg.fromstring(d)
 return pimg

def wxToPIL ( wimg ) : from PIL import Image ( w , h ) = wimg . GetSize ( ) d = wimg . GetData ( ) pimg = Image . new ( 'RGB' , ( w , h ) , color = 1 ) pimg . fromstring ( d ) return pimg
convert a wximage to a pil image .