Graphical tool to make photo collage posters

Overview

PhotoCollage

CI tests status

Graphical tool to make photo collage posters

PhotoCollage allows you to create photo collage posters. It assembles the input photographs it is given to generate a big poster. Photos are automatically arranged to fill the whole poster, then you can change the final layout, dimensions, border or swap photos in the generated grid. Eventually the final poster image can be saved in any size.

The algorithm generates random layouts that place photos while taking advantage of all free space. It tries to fill all space while keeping each photo as large as possible.

PhotoCollage does more or less the same as many commercial websites do, but for free and with open-source code.

screenshot

It provides a library to create photo layouts and posters, and a GTK graphical user interface. PhotoCollage is written in Python (compatible with versions 2 and 3) and requires the Python Imaging Library (PIL).

Features:

  • generate random new layouts until one suits the user
  • choose border color and width
  • possible to swap photos in the generated grid
  • save high-resolution image
  • works even with a large number of photos (> 100)
  • integrates into the GNOME environment
  • available in English, French, German, Czech, Italian, Bulgarian and Dutch

Installation

  • Fedora 19+:

    sudo dnf install photocollage
  • Debian 9+ / Ubuntu 16.10+:

    sudo apt-get install photocollage
  • Using pip, the Python package manager:

    sudo pip3 install photocollage

Usage

After install a launcher for PhotoCollage will appear in your desktop menu.

If it doesn't, just run the command:

photocollage

Hacking

  • If you changed the source and want to test your modifications, run:

    PYTHONPATH=. bin/photocollage

    or:

    python3 -c 'from photocollage import gtkgui; gtkgui.main()'
  • If you need to build a package from source and install it:

    # Install dependencies
    sudo dnf install python3-pillow python3-gobject
    sudo apt-get install python3-pil python3-gi
    sudo pacman -S python-pillow python-gobject
    
    # Install PhotoCollage
    python3 setup.py sdist
    pip3 install --user --upgrade dist/photocollage-*.tar.gz
  • If you wish to contribute, please lint your code and pass tests:

    flake8 .
    python3 -m unittest tests/test_*.py
Comments
  • Application can't start (No module named 'PIL')

    Application can't start (No module named 'PIL')

    Hello!

    I got this error when I try to start photocollage :

    -------- Output error -------- Traceback (most recent call last): File "./photocollage", line 21, in from photocollagelib import gtkgui File "/home/xxxxxxx/Programmes/PhotoCollage-master/photocollagelib/gtkgui.py", line 25, in import PIL.Image ImportError: No module named 'PIL'

    -------- End of output error --------

    I have this when I download the archive or when I install it manually.

    opened by Nico207 9
  • Cool program! I keep getting

    Cool program! I keep getting "broken data stream" error, though.

    Hi! Thanks for this program, it looks really neat and seems to do what I want. I really appreciate your efforts.

    Every time I try to make a collage, I get this error:

    image

    I am able to open the images in eog and display them in the browser, so I think they're good. But it'd be cool if there was an option (or by default) to simply ignore images that aren't working for photocollage.

    Thanks again, hope you have a nice day.

    opened by harold 7
  • Please add a way to set desired aspect ratio

    Please add a way to set desired aspect ratio

    I would like to be able to create European sized posters (A3, A4 etc). It would be great to be able to set the aspect ratio about 1:1.414 for A4, for example so that the posters are the right shape for the destination printout.

    Many thanks!

    opened by jhawkesworth 6
  • Drag&Drop

    Drag&Drop

    More than an issue is a feature request: would be nice if it work with Drag & Drop images from nautilus itself into the "poster area".

    Thanks, C

    opened by rollsappletree 6
  • Missing dependencies

    Missing dependencies

    Try to install using pip failed on my system. You probably need to add a dependency on DistUtilsExtra. (Solved using apt-get install python3-distutils-extra)

    After installing it fails to start with another missing dependency (PIL). (Solved using apt-get install python3-pil).

    # pip3 install photocollage
    Downloading/unpacking photocollage
      Downloading photocollage-1.3.0.tar.gz (186kB): 186kB downloaded
      Running setup.py (path:/tmp/pip-build-j8cqyb84/photocollage/setup.py) egg_info for package photocollage
        Traceback (most recent call last):
          File "<string>", line 17, in <module>
          File "/tmp/pip-build-j8cqyb84/photocollage/setup.py", line 6, in <module>
            from DistUtilsExtra.command import build_extra, build_i18n
        ImportError: No module named 'DistUtilsExtra'
        Complete output from command python setup.py egg_info:
        Traceback (most recent call last):
    
      File "<string>", line 17, in <module>
    
      File "/tmp/pip-build-j8cqyb84/photocollage/setup.py", line 6, in <module>
    
        from DistUtilsExtra.command import build_extra, build_i18n
    
    ImportError: No module named 'DistUtilsExtra'
    
    ----------------------------------------
    Cleaning up...
    Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-j8cqyb84/photocollage
    
    $ photocollage 
    Traceback (most recent call last):
      File "/usr/local/bin/photocollage", line 23, in <module>
        from photocollage import gtkgui
      File "/usr/local/lib/python3.4/dist-packages/photocollage/gtkgui.py", line 30, in <module>
        from photocollage import APP_NAME, artwork, collage, render
      File "/usr/local/lib/python3.4/dist-packages/photocollage/render.py", line 24, in <module>
        import PIL.Image
    ImportError: No module named 'PIL'
    
    opened by herm 5
  • Drop support for EOL Python 2.7-3.4

    Drop support for EOL Python 2.7-3.4

    Same as #67 but also drops support for EOL versions.

    • https://devguide.python.org/#status-of-python-branches
    • https://devguide.python.org/devcycle/#end-of-life-branches
    opened by hugovk 4
  • Cannot choose width and height  independently from each other

    Cannot choose width and height independently from each other

    Thanks for this application. It is really good and useful! I just found one issue when using it. Using from commit e2d61fcf6c24c38cb693fde143b54c5dcdf6e31e (Sun Nov 22). Save poster dialog shows the Poster height field disabled, so I cannot freely choose the dimensions of the final image. Is it possible to choose width and height independently from each other? Thanks!

    opened by gastonsimone 4
  • Filenames with umlauts cannot be imported

    Filenames with umlauts cannot be imported

    I noticed that I cannot drag and drop images from a directory containing an umlaut (Käsekuchen) into the program, it would tell me that the file does not exist and show the path in question in apparently different encoding, I guess latin1. This means that somewhere the filename gets treated with the wrong encoding. Renaming the directory to Kaesekuchen fixed it.

    opened by martin-ueding 3
  • #10: Antonio: Implemented a way to make moving pictures within their …

    #10: Antonio: Implemented a way to make moving pictures within their …

    Hi Adrien,

    I realised that the functionality #10 has already been implemented just after I did it myself. My solution is very similar to the one provided by jdavidberger, with the difference that there's no need to press the CTRL button to move the image.

    For more info see the description below.

    Any reason why the other pull request wasn't merged yet? Furthermore how long usually take for the update of the apt repository?

    Kind regards Antonio

    Commmit Comment: The Photo object has been updated with two extra properties: offset_w and offset_h which represent respectively the offset on the width and the offset on the height of a photo within their frame. The offset value must be a number between 0 and 1:

    • 0: means the photo is not cut on the left (top) but is fully cut on the right (bottom)
    • 1: means the photo is not cut on the right (bottom) but is fully cut on the left
    • 0.5: is the default value and means the photo is centered
    • any other value betwen 0 and 1 will move the photo within the frame A public move method has been added to move the photo within the cell.

    ImagePreviewArea.SWAPPING has been renamed as SWAPPING_OR_MOVING because when clicking, moving the mouse and realising will trigger two different actions: - SWAPPING: if the release of the button is done on another cell - MOVING: if the release of the button is done on the same cell The method ImagePreviewArea.button_release_event() has been accordingly modified.

    The method RenderingTask.resize_photo() has been modified to take the offset in account.

    opened by antonioalonzi 3
  • import urllib.parse in photocollage/gtkgui.py doesn't work with Python 2.7

    import urllib.parse in photocollage/gtkgui.py doesn't work with Python 2.7

    Hello,

    there seems to be an issue with running PhotoCollage 1.3 on Python 2.7. The urllib.parse import works different compared to Python 3.

    Would it be possible to fix the import in gtkgui.py in a way that it works for both versions?

    Thanks & kind regards, Matthias

    opened by mpeterma 3
  • render: Do not crash on corrupted JPEG2000 images

    render: Do not crash on corrupted JPEG2000 images

    Avoid "OSError: broken data stream when reading image file" on truncated files; instead, try to continue reading the file if possible.

    Fixes #65.

    opened by adrienverge 2
  • Immediately exits on start without error.

    Immediately exits on start without error.

    I'm using the Miniforge Python distribution on an M1 Mac. All dependencies appear to be available. I made a minor change to artwork.py (see #82), adding gi.require_version('GdkPixbuf', '2.0'). I get the following:

    $ python3 -m photocollage.gtkgui
    $
    

    It immediately exits with exit code 0 (EXIT_SUCCESS). No window appears.

    opened by rljacobson 0
  • Roll-Up of Features + Reset Button and development environment

    Roll-Up of Features + Reset Button and development environment

    All features have been tested and are working.

    Integrates the following features:

    • Added commandline tool: https://github.com/adrienverge/PhotoCollage/pull/70
    • Create config class, to handle session and parameters to filesystem: https://github.com/adrienverge/PhotoCollage/pull/60
    • Now remembers last visited directory: https://github.com/adrienverge/PhotoCollage/pull/52

    Adds:

    1. Reset Button - removes all images from collage in one click.
    2. Modern development workflow for Windows, using VSCode and Docker devcontainer. Also includes test images from public dataset.

    opened by zkhcohen 0
  • cannot import name GdkPixbuf, introspection typelib not found

    cannot import name GdkPixbuf, introspection typelib not found

    ➜  ~ photocollage
    Traceback (most recent call last):
      File "/usr/local/bin/photocollage", line 21, in <module>
        from photocollage import gtkgui
      File "/usr/local/lib/python3.9/site-packages/photocollage/gtkgui.py", line 29, in <module>
        from photocollage import APP_NAME, artwork, collage, render
      File "/usr/local/lib/python3.9/site-packages/photocollage/artwork.py", line 21, in <module>
        from gi.repository import GdkPixbuf
      File "/usr/local/lib/python3.9/site-packages/gi/importer.py", line 131, in load_module
        raise ImportError('cannot import name %s, '
    ImportError: cannot import name GdkPixbuf, introspection typelib not found
    
    opened by Drjacky 1
  • Feature Request: Zoom

    Feature Request: Zoom

    I love PhotoCollage, and have used it many times now. One feature I wish to be implemented is a zoom of the canvas. With the window full screen on a modern high res display, the canvas remains the same size. This is ok when there is a low count of photos, but unusable with a higher count. Thank you!

    Edit: Removing a photo enlarged the canvas to the window size.

    opened by keilmillerjr 0
  • Not centered images are not shown properly

    Not centered images are not shown properly

    If the image isnt centered, all the proposed outputs might show an empty non-useful view... It would be nice if we are allowed to apply some changes manually to pics such as moving them within their frame to have the correct output

    opened by Enissay 1
Owner
Adrien Vergé
Adrien Vergé
Random collage/montage generator with drop-shadow

Random Collage Example Usage These are the sample input files in $PWD for the below examples: 1.png 2.png 3.png 4.png 5.png 6.png 7.png 8.png 9.png 10

M B 1 Dec 7, 2021
a lite weight photo editor written in python for day to day photo editing!

GNU-PhotoShop A lite weight Photo editing Program (currently CLI only) written in python3 for day to day photo editing. Disclaimer : Currently we don'

Kunal Sharma 5 May 30, 2022
A tool for making simple-style text posters or wallpapers with high resolution.

PurePoster PurePoster is a fancy tool for making arbitrary-resolution, simple-style posters or wallpapers with text in center. Functionality PurePoste

Renyang Guan 4 Jul 9, 2022
thumbor is an open-source photo thumbnail service by globo.com

Survey If you use thumbor, please take 1 minute and answer this survey? It's only 2 questions and one is multiple choice!!! thumbor is a smart imaging

Thumbor (by @globocom) 9.3k Dec 31, 2022
thumbor is an open-source photo thumbnail service by globo.com

Survey If you use thumbor, please take 1 minute and answer this survey? It's only 2 questions and one is multiple choice!!! thumbor is a smart imaging

Thumbor (by @globocom) 8.2k Feb 23, 2021
📷 Python package and CLI utility to create photo mosaics.

?? Python package and CLI utility to create photo mosaics.

Loic Coyle 7 Oct 29, 2022
Nutrify - take a photo of food and learn about it

Nutrify - take a photo of food and learn about it Work in progress. To make this a thing, we're going to need lots of food images... Start uploading y

Daniel Bourke 93 Dec 30, 2022
Black-white image converter - Black-white photo colorization

Black-white image converter - Black-white photo colorization

null 1 Jan 2, 2022
Python-fu-cartoonify - GIMP plug-in to turn a photo into a cartoon.

python-fu-cartoonify GIMP plug-in to turn a photo into a cartoon. Preview Installation Copy python-fu-cartoonify.py into the plug-in folder listed und

Pascal Reitermann 6 Aug 5, 2022
clesperanto is a graphical user interface for GPU-accelerated image processing.

clesperanto is a graphical user interface for a multi-platform multi-language framework for GPU-accelerated image processing. It is based on napari and the pyclesperanto-prototype.

null 1 Jan 2, 2022
Make your master artistic punk avatar through machine learning world famous paintings

Master-art-punk Make your master artistic punk avatar through machine learning world famous paintings. 通过机器学习世界名画制作属于你的大师级艺术朋克头像 Nowadays, NFT is beco

蒋虎成 23 Jan 4, 2022
Make GIFs from time-stacked xarray.DataArrays (time, [optional band], y, x), dead-simple.

GeoGIF Make GIFs from time-stacked xarray.DataArrays (time, [optional band], y, x), dead-simple. from geogif import gif, dgif gif(data_array) dgif(das

Gabe Joseph 47 Dec 22, 2022
Image Processing - Make noise images clean

影像處理-影像降躁化(去躁化) (Image Processing - Make Noise Images Clean) 得力於電腦效能的大幅提升以及GPU的平行運算架構,讓我們能夠更快速且有效地訓練AI,並將AI技術應用於不同領域。本篇將帶給大家的是 「將深度學習應用於影像處理中的影像降躁化 」,

null 2 Aug 4, 2022
An add to make adding screenshots and copied images to the scene easy

Blender Clipboard to Scene It doesn't work with version 2.93 and higher (I tested it on 2.91 and 2.83) There is an issue with importing the Pillow mod

Mohammad Mehdi Afkhami 3 Dec 29, 2021
Gaphor is the simple modeling tool

Gaphor Gaphor is a UML and SysML modeling application written in Python. It is designed to be easy to use, while still being powerful. Gaphor implemen

Gaphor 1.3k Dec 31, 2022
Deep Illuminator is a data augmentation tool designed for image relighting.

Deep Illuminator Deep Illuminator is a data augmentation tool designed for image relighting. It can be used to easily and efficiently genera

George Chogovadze 52 Nov 29, 2022
Depix is a tool for recovering passwords from pixelized screenshots.

This implementation works on pixelized images that were created with a linear box filter. In this article I cover background information on pixelization and similar research.

null 23.1k Jan 4, 2023
Rembg is a tool to remove images background.

Rembg is a tool to remove images background.

Daniel Gatis 7.8k Jan 5, 2023