Robert wrote: > I'm new to PIL and wanted to use Image.tostring for inline graphics > under mod-python. Seems like a good fit but I can't seem to come up with > the format of the required second parameter when you do > > output = im.tostring ("jpeg", ???)
tostring() should only be used if you want to transfer the actual pixels to some other library (e.g. numpy), or if you're doing custom encoding for non-standard formats. if you want to save an image in a standard format, use im.save() and a StringIO buffer instead: f = StringIO.StringIO() im.save(f, "JPEG") data = f.getvalue() </F> _______________________________________________ Image-SIG maillist - Image-SIG@python.org http://mail.python.org/mailman/listinfo/image-sig