Recreate an image with many others
Project description
Create collages of images.
Installation
Install the package via either of these options:
-
$ git clone https://github.com/kklein/pycollage.git $ conda env create -f environment.yml $ conda activate pycollage $ pip install --no-build-isolation -e .
$ pip install pycollage
$ conda install pycollage -c conda-forge
Usage
In order to use pycollage
, you should have a collection of images
which makes up for the individual components of the collage as well
as a target image which the collage seeks to imitate.
In the following we will assume that you saved the image collection under
/users/Anne/image_collection
and the target image under
/users/Anne/target_image.png
. Best use absolute paths.
Processing the collection
The first step consists of processing the image collection. In order to do so, run
$ pycollage process-collection /users/Anne/image_collection
By default, this will resize the images to each be 20x20 pixels. If you'd like a different component size, e.g. 30x30 pixels, run
$ pycollage process-collection /users/Anne/image_collection --component_size 30
instead.
You will notice that executing this will tell you where an index directory has been
created. Given the paths from above, this should be /uers/Anne/index
. Moreover
another new directory has been created: /users/Anne/image_collection_resized
.
Building a collage
Now that the collection has been duely processed, we can embark onto actually building a collage.
For that purpose, simply run
$ pycollage build /users/Anne/index /users/Anne/target_image
where the first path corresponds to the path that was mentioned to you
when executing process_collection
.
At the end of the process both the original target image as well as the collage imitating the target image will be opened. You can then save the collage to wherever you like.
Runtime
Note that this process will take longer
- the larger the
component_size
you provide - the larger your collection of images
- the larger the resolution of the target image
Since the collage will scale up the original target image by component_size
per
dimensions - i.e., 20 by default - you might want to scale down your original
target image to below 1000x1000 pixels.
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
File details
Details for the file pycollage-0.0.0.tar.gz
.
File metadata
- Download URL: pycollage-0.0.0.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d80f2b638626e9d419862aa3ede3153ecbbb616e786a678c5cb07533bf5a3600 |
|
MD5 | b691d42fe1daaab2bd3e30794d17a546 |
|
BLAKE2b-256 | 98e2ebc8f5470d7f7a6b2313747cb79bb2ec1eb2d563e567fd4bc6f8f4692378 |
File details
Details for the file pycollage-0.0.0-py3-none-any.whl
.
File metadata
- Download URL: pycollage-0.0.0-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c67b15d6467bd33e929926f2ce68033a2bec2d2007c81b041eaf032113bcb76 |
|
MD5 | f23f912a4b3b44f2cb0bbd1636a6f80a |
|
BLAKE2b-256 | 03b45abbbf8a5ca6f84b750e8ffbf45b7c53ab126a58fe0608482332582ee6bd |