Get the pixel form of the digits of pi as a wallpaper using either the number of digits of pi you want or the screen resolution.
Before you begin, ensure you have met the following requirements:
-
You have installed the latest version of Python3
-
You have the pip package manager.
-
You have the jupyter notebook installed.
-
Microsoft Visual Studio 2019 Build Tools (https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2017) and add to Environment Variable (Control Panel> System and Security> System> Advanced System Settings> Advanced> Environment Variables> Path) and add the path of the folder containing the cl.exe file (in this system, it's at C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.24.28314\bin\Hostx64\x86).
-
For gmpy2 installation in Windows 10, download the pre-compiled binary file (gmpy2-2.0.8-cp36-cp36m-win_amd64.whl from https://www.lfd.uci.edu/~gohlke/pythonlibs/#gmpy ) Then run
pip install gmpy2-2.0.8-cp36-cp36m-win_amd64.whl
If the above are too complicated you can use the Python3 version of Anaconda which serves the same purpose. But requires a bit more of processing power and storage to install.
To get started with pi-art, follow these steps:
- Clone the repository to your local machine.
- Change to the repo directory.
- Run the following command to install the required packages.
pip install -r requirements.txt
- Start the jupyter notebook.
jupyter notebook
- It opens up the web browser.
- Navigate to the repo directory.
- You will find two files.
- code.ipynb
- square.ipynb
For this, you will have to open the square.ipynb
file in the jupyter webpage.
Now change the value of the number_of_digits
variable in the notebook.
Once it is changed, run the whole notebook.
The output will be a square image of pi
with the maximum possible digits of the given value in the number_of_digits
crammed into it.
For this, you will have to open the code.ipynb
file in the jupyter webpage.
Now change the value of the width
and height
variables in the notebook.
Once it is changed, run the whole notebook.
The output will be an image of pi
for the resolution specified.
The output of the notebook will be stored in the file named pi-art.png
in the same folder.
To contribute to pi-art, follow these steps:
- Fork this repository.
- Create a branch:
git checkout -b <user_name>
. - Make your changes and commit them:
git commit -m '<commit_message>'
- Push to the original branch:
git push origin <project_name>/<location>
- Create the pull request.
If you want to contact me you can reach me at [email protected].
Have a great day :)