This project allows users to generate a unique collage from a collection of images. The collage consists of slices from each image, either taken from a random location within each image or centered. After creating the main collage, the program also generates low-quality preview versions of each image used in the collage.
- Creates a collage from a directory of images.
- Option to sample random parts of an image or use the middle for the collage.
- Generates low-quality previews of each image with watermark.
- Python 3.x
- PIL (Python Imaging Library)
- Clone this repository:
git clone https://github.com/streek/collage-creator.git
- Install the required packages:
pip install pillow
- Place your images in a directory (e.g.,
./images
). - Run the script:
python collage_creator.py
- By default, the collage will be saved as
collage.jpg
and the previews will be saved asimage_1.jpg
,image_2.jpg
, etc.
You can customize the output by adjusting the following parameters when calling the create_collage
function:
directory
: The directory containing the images.output_filename
: The filename for the output collage.width
&height
: Dimensions of the collage.text_position
: Position of the watermark on the collage ('center'
or'bottom_right'
).font_size
: Font size of the watermark.random_sample
: Set toTrue
for random sampling orFalse
to use the middle of each image.
This project is licensed under the MIT License. See the LICENSE file for details.
- Fork the project.
- Create your feature branch (
git checkout -b feature/AmazingFeature
). - Commit your changes (
git commit -m 'Add some AmazingFeature'
). - Push to the branch (
git push origin feature/AmazingFeature
). - Open a pull request.
- Thanks to OpenAI for initial guidance.