This project loads a set of images from a specified directory and arranges them into a grid layout. It allows customization of the grid dimensions (number of columns and rows) as well as the margin between images. The resulting grid image is saved as output.

Install OpenCV:

pip install opencv-python

Place the images you want to arrange into a grid in a directory named images within the project folder.

Run the script:

python grid_composition.py

Adjust the columns, rows, horizontal_margin, and vertical_margin variables in the script to customize the grid layout and spacing between images.

The composed grid image will be saved as grid.jpeg in the project folder.