A Python application that creates a mosaic image using turtle graphics. The program dynamically generates a color list from a PDF file and uses this list to draw a mosaic based on the Rubik's cube dimensions selected by the user.
- Generates a color list from a PDF file for a mosaic image.
- Utilizes turtle graphics to draw the mosaic.
- Supports custom dimensions for better image quality.
Ensure you have Python installed on your system. You can download it from python.org.
-
Create a virtual environment to manage project dependencies:
python -m venv mosaic-venv
-
Activate the virtual environment:
-
On Windows:
mosaic-venv\Scripts\activate
-
On macOS/Linux:
source mosaic-venv/bin/activate
-
-
Install the required dependencies listed in
requirements.txt
:pip install -r requirements.txt
- Visit https://bestsiteever.ru/mosaic/ to generate the PDF file for the color list.
- Follow the instructions on this GitHub repository to understand how to create the mosaic PDF.
- Note: For better image quality, it is recommended to choose Rubik's cube dimensions of 5 and above.
-
Once you have generated the PDF file, update the
filepath
anddimension
variables in thescript/main.py
file to reflect the path where your image is located:if __name__ == "__main__": filepath = "../sample_images/<your_initials>/your_file.pdf" dimension = <your_selected_dimension> # 3 for 3x3x3, 5 for 5x5x5, etc
-
For a more organized approach, create a directory in
sample_images/<your_initials>/
to store your PDF file.
-
Open your terminal and navigate to the
script
directory:cd script
-
Run the following command to execute the program and create your mosaic image:
python main.py
This project is licensed under the MIT License - see the LICENSE file for details.