/India-map-python

Generates a mosaic art of India map from an image using Python.

Primary LanguageJupyter Notebook

India Map Python

Generates a mosaic art of India map from an image using Python. Uses the PIL library to generate the mosaic art and turtle to draw the map.

Requirements

  • Python 3.6
  • PIL
  • turtle

Usage

  • Clone the repository
  • Run the following command in the terminal
python india.py

Output

demo-timelapse.mp4

How it works?

  1. Input image:
    india-colored

  2. Vertical slices of the image:
    filter-vertical

  3. Horizontal slices of the image:
    filter-horizontal

  4. Vertical and horizontal slices are superimposed to form a grid:
    filtered

  5. Each grid is given the center color that grid:
    color-normalized

  6. Color of each grid is compared with the color of the corresponding grid in the map:
    color-standard

  7. Small output image is generated:
    india-final

  8. Then pixels of the small output image are drawn randomly on turtle canvas. Final output:
    demo-image