{"id":19961030,"url":"https://github.com/twilsonco/pyphotocollage","last_synced_at":"2026-03-05T22:08:34.027Z","repository":{"id":43302693,"uuid":"266837914","full_name":"twilsonco/PyPhotoCollage","owner":"twilsonco","description":"CLI, Pythonista (iOS App), and Siri Shortcut to combine 3 or more images into a collage, maintaining image aspect ratios and distributing images evenly over collage rows.","archived":false,"fork":false,"pushed_at":"2025-09-14T03:36:40.000Z","size":61668,"stargazers_count":42,"open_issues_count":1,"forks_count":10,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-09-14T05:40:19.691Z","etag":null,"topics":["collage","collage-maker","pil","pillow","python","python-3","pythonista","pythonista-ios","pythonista-scripts","pythonista3"],"latest_commit_sha":null,"homepage":"https://routinehub.co/shortcut/17870/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/twilsonco.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-05-25T17:17:47.000Z","updated_at":"2025-09-14T03:36:44.000Z","dependencies_parsed_at":"2023-12-02T19:27:15.192Z","dependency_job_id":"d8f47729-da78-4876-bff4-3e212d48b941","html_url":"https://github.com/twilsonco/PyPhotoCollage","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/twilsonco/PyPhotoCollage","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twilsonco%2FPyPhotoCollage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twilsonco%2FPyPhotoCollage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twilsonco%2FPyPhotoCollage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twilsonco%2FPyPhotoCollage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/twilsonco","download_url":"https://codeload.github.com/twilsonco/PyPhotoCollage/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twilsonco%2FPyPhotoCollage/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30152089,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T21:15:50.531Z","status":"ssl_error","status_checked_at":"2026-03-05T21:15:11.173Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["collage","collage-maker","pil","pillow","python","python-3","pythonista","pythonista-ios","pythonista-scripts","pythonista3"],"created_at":"2024-11-13T02:06:10.357Z","updated_at":"2026-03-05T22:08:34.019Z","avatar_url":"https://github.com/twilsonco.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![title image](img/1.png)\n\n# PyPhotoCollage\n\nCombines 3 or more images into a collage, maintaining image aspect ratios and distributing images evenly.\n\nDissatisfied with the Siri Shortcuts image gridding capability, I wanted a photo collage tool that can distribute images evenly. It grew into the current utility.\n\nAfter looking around, the idea for this tool came from Johannes Treitz's blog post (which no longer exists...).\nThe problem is reduced to the [partition problem](http://www8.cs.umu.se/kurser/TDBAfl/VT06/algorithms/BOOK/BOOK2/NODE45.HTM), for which I used [this SO implementation](https://stackoverflow.com/a/7942946).\nMain function was modified (significantly) from [delimitry's _collage_maker_](https://github.com/delimitry/collage_maker).\n\n![aspect ratio and image ordering](img/2.png)\n![collage type and nesting](img/3.png)\n![collage spacing and corner rounding](img/4.png)\n![image rotation](img/5.png)\n\n# Notes for Pythonista and Siri Shortcut versions\n\n* Photo collage can crash if too much memory is used\n* If this happens, use the included \"Preprocess images\" utility to downscale images to a smaller size, then rerun Photo collage\n* It will also run faster if preprocessing is done first\n* Can run by sharing images from the Share Sheet (works better with Siri Shortcut; Pythonista version makes you reselect images)\n\n![share sheet](img/share_sheet.png)\n\n# [Pythonista](http://omz-software.com/pythonista/) version for iPhone/iPad/Apple Silicon Mac\n\n* Takes no arguments.\n* Options are specified by the user when run.\n* Simply place in the app, locally or though iCloud.\n* If you want to run it from _e.g._ iOS Shortcuts, you'll need to store it locally.\n* If you want to run it from the Share Sheet, you'll need to add it to the Pythonista extension (see image below)\n  * Due to limitations in Pythonista, starting Photo collage from the share sheet *will not pass through the selected images; you'll need to reselect them*\n  * It crashes when more than a handful of images are passed via the share sheet, so I had to revert that functionality\n\n![Pythonista interface](img/pythonista.png)\n\n![Pythonista Share Sheet setup](img/pythonista_setup.png)\n  \n# [Native Siri Shortcut](https://routinehub.co/shortcut/17870/)\n\n* PyPhotoCollage is also implemented as a vanilla Siri Shortcut that runs on Mac/iPhone/iPad\n* Has all the same options and capabilities\n* *It's slow compared to the Python version; very slow*\n\n![Siri Shortcut interface](img/shortcut.png)\n\n# Mac/PC CLI version\n\n## Requirements\n\n* Python3\n* PIL (Pillow)\n\n## Usage\n\n```\nusage: PhotoCollage.py [-h] [-f FOLDER] [-R] [-F FILE] [-o OUTPUT] [-t COLLAGE_TYPE] [-O ORDER] [-S MAX_SIZE] [-r TARGET_ASPECT_RATIO] [-g IMAGEGAP] [-m ROUND_IMAGE_CORNERS_PERC]\n                       [-M ROUND_COLLAGE_CORNERS_PERC] [-b BACKGROUND] [-c COUNT] [-a] [-i INIT_SIZE] [-N MAX_RECURSION_DEPTH] [-s]\n                       [files ...]\n\nPhoto collage maker\n\npositional arguments:\n  files\n\noptions:\n  -h, --help            show this help message and exit\n  -f FOLDER, --folder FOLDER\n                        folder with 3 or more images (*.jpg, *.jpeg, *.png)\n  -R, --recurse-input-folder\n                        recurse into subfolders of input folder\n  -F FILE, --file FILE  file with newline separated list of 3 or more files\n  -o OUTPUT, --output OUTPUT\n                        output collage image filename\n  -t COLLAGE_TYPE, --collage-type COLLAGE_TYPE\n                        collage type (default: nested; possible: nested, row, column)\n  -O ORDER, --order ORDER\n                        order of images (default: input_order; possible: filename, random, oldest_first, newest_first, input)\n  -S MAX_SIZE, --max_collage_size MAX_SIZE\n                        cap the longest edge (width or height) of resulting collage\n  -r TARGET_ASPECT_RATIO, --target-aspect-ratio TARGET_ASPECT_RATIO\n                        target aspect ratio for collage\n  -g IMAGEGAP, --gap-between-images IMAGEGAP\n                        number of pixels of transparent space (if saving as png file; otherwise black or specified background color) to add between neighboring images\n  -m ROUND_IMAGE_CORNERS_PERC, --round-image-corners-perc ROUND_IMAGE_CORNERS_PERC\n                        percentage of shortest image edge to use as radius for rounding image corners (0.0 to 100.0)\n  -M ROUND_COLLAGE_CORNERS_PERC, --round-collage-corners-perc ROUND_COLLAGE_CORNERS_PERC\n                        percentage of shortest collage edge to use as radius for rounding collage corners (0.0 to 100.0)\n  -b BACKGROUND, --background-color BACKGROUND\n                        color (r,g,b) to use for background if spacing is added between images\n  -c COUNT, --count COUNT\n                        count of images to use, if fewer are desired than those specified or contained in the specified folder\n  -a, --no-antialias-when-resizing\n                        for performance, disable antialiasing on intermediate resizing of images (runs faster but output image looks worse; final resize is always antialiased)\n  -i INIT_SIZE, --init-image-size INIT_SIZE\n                        to decrease necessary memory, resize images on input to set longest edge length\n  -N MAX_RECURSION_DEPTH, --max-nested-collage-depth MAX_RECURSION_DEPTH\n                        maximum number of levels of nesting. The more levels there are, the larger the size difference will be between the smallest and largest images in the\n                        resulting collage (default: 2)\n  -s, --show-recursion-depth\n                        show recursion depth by adding border to images\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwilsonco%2Fpyphotocollage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftwilsonco%2Fpyphotocollage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwilsonco%2Fpyphotocollage/lists"}