A simple grid collage maker for creating image collages from a folder
Project description
MkCollage
A simple command-line tool for creating grid collages from a folder of images. Automatically determines the most common aspect ratio from your images and preserves all original image content without cropping.
Installation
Install using uv:
uv sync
Usage
Basic usage (auto-detects aspect ratio, outputs to current directory with folder name):
mkcollage /path/to/images
# Creates: ./images.jpg
Specify output filename:
mkcollage /path/to/images mycollage
# Creates: ./mycollage.jpg (in current directory)
Specify full output path:
mkcollage /path/to/images /output/path/collage.jpg
# Creates: /output/path/collage.jpg
With custom options:
mkcollage /path/to/images output.jpg \
--size 2560 \
--padding 20 \
--centered \
--background "#000000" \
--quality 80
Specify exact dimensions:
mkcollage /path/to/images output.jpg \
--width 1920 \
--height 1080
Add a title to the collage:
mkcollage /path/to/images output.jpg \
--title "My Photo Collection" \
--title-size 64 \
--title-color "#FFFFFF" \
--title-border 3 \
--title-border-color "#000000"
Use custom font for title:
mkcollage /path/to/images output.jpg \
--title "Vacation 2025" \
--title-font /path/to/font.ttf \
--title-size 72
Reserve space for title (instead of drawing over collage):
mkcollage /path/to/images output.jpg \
--title "My Collection" \
--title-margin
Command-line Options
folder- Path to folder containing images (required)output- Output filename (optional, defaults to folder name). If no path is given, saves to current directory. Extension defaults to .jpg if not provided.--size- Target size for the larger dimension of the collage (default: 1920)--width- Width of the output collage (overrides --size and auto aspect ratio)--height- Height of the output collage (overrides --size and auto aspect ratio)--padding- Padding between images in pixels (default: 5)--centered- Center the grid if canvas is not square--background- Background color in hex format (default: #000000)--quality- JPEG quality (1-100, default: 80)--title- Title text to add to top-left corner (optional)--title-size- Title font size in pixels (default: 24)--title-font- Path to TTF font file (uses system default if not specified)--title-color- Title text color in hex format (default: #FFFFFF)--title-border- Title text border/stroke width in pixels (default: 2)--title-border-color- Title text border color in hex format (default: #000000)--title-margin- Reserve space at the top for the title instead of drawing over the collage
Supported Image Formats
- JPEG (.jpg, .jpeg)
- PNG (.png)
- GIF (.gif)
- BMP (.bmp)
- WebP (.webp)
Features
- Automatic aspect ratio detection - Analyzes all images and uses the most common aspect ratio
- Preserves original content - No cropping! Images are resized to fit while maintaining their aspect ratio
- Smart letterboxing - Adds background color bars when needed to fit images in grid cells
- Grid layout optimization - Automatically arranges images based on the canvas dimensions
- Sorted processing - Images are processed in alphabetical order
- Flexible sizing - Auto-calculate dimensions or specify exact width/height
- Optional title text - Add customizable title with font, size, color, and border options
- Customizable - Adjust padding, centering, background color, and JPEG quality
How It Works
- Scans the specified folder for all image files
- Analyzes the aspect ratios of random 20 images
- Determines the most common aspect ratio (e.g., 16:9, 4:3)
- Calculates optimal canvas dimensions based on that ratio
- Creates a grid layout that fits all images
- Resizes each image to fit its grid cell while preserving aspect ratio
- Adds letterboxing/pillarboxing with the background color as needed
- Saves the final collage
Requirements
- Python >= 3.8
- Pillow >= 10.0.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mkcollage-1.0.0.tar.gz.
File metadata
- Download URL: mkcollage-1.0.0.tar.gz
- Upload date:
- Size: 10.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
808ac01536739398fd4e1cf1c10e5d0d5503d4852e77cdc6534782f855ea3244
|
|
| MD5 |
282ea2c5232ed3383864836e736a50de
|
|
| BLAKE2b-256 |
b6e2fb786d5d28351c1d6d85bf30c2d62646005315495c9e3cf0dbc01f9cbeac
|
File details
Details for the file mkcollage-1.0.0-py3-none-any.whl.
File metadata
- Download URL: mkcollage-1.0.0-py3-none-any.whl
- Upload date:
- Size: 12.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c2934929f209ab114013dcd024e3eb1e8d1cafc313100e1ff9de1199fd7a443b
|
|
| MD5 |
15d2a7e729e6d849109c0fdf14fc11e2
|
|
| BLAKE2b-256 |
16210a2fd301007a8c0f01721263e58519d05d58655f4ba8ddaac9ffb88ce7e9
|