Table of Contents
Dice Art is a unique form of artistic expression that involves creating intricate designs or images using dice as the primary medium. By arranging and manipulating dice in various patterns, artists produce visually captivating pieces that not only showcase creative prowess but also highlight the intersection of gaming culture and visual arts, offering a fresh perspective on the role of randomness and chance in our society. In this project, a user is able to upload an image of their choice and have it visualized using only the six sides of a regular die through leveraging Python
's imaging library (PIL
) and Streamlit
capabilities.
- Accepts images as any type of valid file (.jpeg, .png, .webp, etc.)
- User-friendly Interface (Streamlit functionalities)
- Interface utilizes visual effects such as progress bars, on-screen animations, and alerts.
- Image Resizing -> Resize images so dice will fit evenly on the canvas.
- Creating a canvas -> Create a new canvas, scaled up to account for the size of the die, with image resizing accounted.
- Greyscaling -> Sectioning parts of the picture off of HEX-value brightness with the help of greyscaling.
- "Dicing" -> Implement dice in parts of the picture to represent certain brightness levels, with a one-sided die having the lowest brightness and 5 & 6 having the most.
- Minimalistic user-interface, requiring little-to-no effort to use, simply Drag & Drop!
- Interface will illustrate a loading bar, visual animations, and a success bar when finished.
- The output is a .png type which is available for download if needed.
- The thought process behind this project can be found here, as well to note, each helper function in main.py has been documented to provide insight of purpose.
- Clone the repository using the following
git clone https://github.com/v5run/DiceArt.io.git
- Install Python 3.12 and Streamlit. Run the following command in CMD to install Streamlit.
pip install streamlit
- Run the program in any text-editor/terminal using
streamlit run main.py
- Use the .io at your own free will.
Varun Pathak - @LinkedIn - pathav4@mcmaster.ca
Project Link: https://github.com/v5run/DiceArt.io