Skip to content

A python script that generates a mosaic picture of any image using the turtle library when given the right list of colours.

License

Notifications You must be signed in to change notification settings

Richard-Quayson/mosaic-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mosaic Generator

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.

Features

  • 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.

Prerequisites

Ensure you have Python installed on your system. You can download it from python.org.

Setup

Step 1: Set Up a Virtual Environment and Install Dependencies

  1. Create a virtual environment to manage project dependencies:

    python -m venv mosaic-venv
  2. Activate the virtual environment:

    • On Windows:

      mosaic-venv\Scripts\activate
    • On macOS/Linux:

      source mosaic-venv/bin/activate
  3. Install the required dependencies listed in requirements.txt:

    pip install -r requirements.txt

Step 2: Generate the Mosaic PDF

  1. Visit https://bestsiteever.ru/mosaic/ to generate the PDF file for the color list.
  2. Follow the instructions on this GitHub repository to understand how to create the mosaic PDF.
  3. Note: For better image quality, it is recommended to choose Rubik's cube dimensions of 5 and above.

Step 3: Update the Project with Your File Path

  1. Once you have generated the PDF file, update the filepath and dimension variables in the script/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
  2. For a more organized approach, create a directory in sample_images/<your_initials>/ to store your PDF file.

Step 4: Run the Program

  1. Open your terminal and navigate to the script directory:

    cd script
  2. Run the following command to execute the program and create your mosaic image:

    python main.py

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

A python script that generates a mosaic picture of any image using the turtle library when given the right list of colours.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages