wiki:ServeDynamicImage
Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.
    @expose() 
    def captcha(self,**data): 
        myImage = ImageGenerator() 
        cherrypy.response.headerMap['Content-Type'] = 'image/jpeg' 
        return myImage.to_string('jpeg','RGB')

based on myImage being a PIL image object, using PIL's to_string() function