AkaMatt
Posts: 1
Joined: Tue Apr 09, 2013 9:18 pm

Raspberry Pi making Pi Pictures

Tue Apr 09, 2013 9:32 pm

The other day i came across a interesting a image which explained pi to be a infinite number, it stated that if we turned each digit into a pixel on a monitor somewhere would be a picture of you as pi is infinite.

This got me thinking. Well not really it did all the thinking for me, the ratio pi is infinite, so if i made it draw a picture i could eventually find something cool (through very unlikely.) So in response to this i have decided to run my raspberry pi 24/7 for a while (probably until i get bored and want to use it for something else) running a python program which works out the digits of pi, and turns each digit into a pixel on a picture.

To do this i copied a little code from the internet which created a function to work out pi to a defined amount of places. I took this code and expanded onto it, using pygame i created a screen which would display these pixels. the program in the end used 3 digits from pi to create each pixel, one for each value in pygames RGB display format. The program will create a 500x500 picture from pi. once the picture is finished it carries on creating a new one, for the rest of pi.

So, my pi is generating images from pi :L a cool use, if anyone has any questions about it feel free to ask i'll try reply :3 thanks for reading

Return to “Graphics, sound and multimedia”