<[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Hello. I have recently been experimenting with cellular automata and I
> would like to know how I could convert a 2d list of 0's and 1's into
> white and black squares on an image. I have tried to install matplotlib
> and also NumTut but both to no avail. There seem to be bugs in their
> installation and I have not been able to figure out how to resolve
> them. I would be happy for someone to suggest a library and maybe give
> a simple example of how to do what I want to do.
>
In my 1d cellular automaton, I used the python image library and
import Image
nim = Image.new("1", (height * 2, height))
nim.putdata(bimg)
nim.resize((400,200)).save("output.png")

where bimg is a 2d list of 0's and 1's. You could probably remove the 
resize. 


-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to