new images from strings using PIL
Bill
metaliu at yahoo.com
Mon Mar 4 13:55:55 EST 2002
Ahhhh. Thanks very much.
"Fredrik Lundh" <fredrik at pythonware.com> wrote in message
news:Vvxg8.22784$n4.4309187 at newsc.telia.net...
> try this instead:
>
> >>> pixels = "1 2 3 4 5 6"
> >>> i = Image.new("L", (3, 2))
> >>> i.putdata(map(int, pixels.split()))
>
> >>> list(i.getdata())
> [1, 2, 3, 4, 5, 6]
>
> >>> i.getextrema()
> (1, 6)
>
> (getdata returns a sequence object of an undefined type. to
> see what's in it, convert it to a list or tuple before printing it)
>
> </F>
>
>
More information about the Python-list
mailing list