[Image-SIG] PIL and simple conversion

Gregory Tappero coulix at gmail.com
Mon Dec 1 14:30:47 CET 2008


Hi everyone,

I have a png in P mode with black writting on white background
I want a transparent png with black writting in white

So far i did this

    im = Image.open("foo.png")
    im = im.convert("RGB")
    im = ImageOps.invert(im)
    im = im.convert("P")
    im.save("new2.png", transparency=0)

it works well, except that i dont want to save the image i want the
data to return it
to my web client.

So what is a equivalent of im.save("new2.png", transparency=0) which
does not save the image ?
Thanks

Greg

-- 
o/


More information about the Image-SIG mailing list