Did I find the right examples for you? yes no

All Samples(2)  |  Call(2)  |  Derive(0)  |  Import(0)
convert a wxImage to a PIL Image

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


src/m/a/MAVProxy-1.3.3/MAVProxy/modules/mavproxy_map/mp_image.py   MAVProxy(Download)
        scaled_image = scaled_image.Rescale(int(rect.width*self.zoom), int(rect.height*self.zoom))
        if state.brightness != 1.0:
            pimg = mp_util.wxToPIL(scaled_image)
            pimg = Image.eval(pimg, lambda x: int(x * state.brightness))
            scaled_image = mp_util.PILTowx(pimg)

src/m/a/MAVProxy-HEAD/MAVProxy/modules/lib/mp_image.py   MAVProxy(Download)
        scaled_image = scaled_image.Rescale(int(rect.width*self.zoom), int(rect.height*self.zoom))
        if state.brightness != 1.0:
            pimg = mp_util.wxToPIL(scaled_image)
            pimg = Image.eval(pimg, lambda x: int(x * state.brightness))
            scaled_image = mp_util.PILTowx(pimg)