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
Metadata
Release files for mkcollage 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mkcollage-1.0.0.tar.gz | 10.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mkcollage-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 22.3 kB
Release files / mkcollage-1.0.0.tar.gz
| Download URL | mkcollage-1.0.0.tar.gz |
|---|---|
| Size | 10.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
808ac01536739398fd4e1cf1c10e5d0d5503d4852e77cdc6534782f855ea3244
|
|
BLAKE2b-256 checksum How to use checksums |
b6e2fb786d5d28351c1d6d85bf30c2d62646005315495c9e3cf0dbc01f9cbeac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.9.6
|
Release files / mkcollage-1.0.0-py3-none-any.whl
| Download URL | mkcollage-1.0.0-py3-none-any.whl |
|---|---|
| Size | 12.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c2934929f209ab114013dcd024e3eb1e8d1cafc313100e1ff9de1199fd7a443b
|
|
BLAKE2b-256 checksum How to use checksums |
16210a2fd301007a8c0f01721263e58519d05d58655f4ba8ddaac9ffb88ce7e9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.9.6
|