Assemble thumbnail-sized images from a large collection into a tiling which, viewed at a distance, gives the impression of one large photo.
Project description
photomosaic
===========
Assemble thumbnail-sized images from a large collection into a mosaic which,
viewed at a distance, gives the impression of one large photo.
Example
-------
```python
import photomosaic as pm
# Load a sample image
from skimage import data
img = data.chelsea() # cat picture!
# Generate dummy images covering the color gamut to use as a pool.
pm.generate_tile_pool('pool')
# Build the pool (analyze the dummy images).
pool = pm.make_pool('pool/*.gif')
# Create a mosiac with 15x15 tiles.
mos = pm.basic_mosaic(img, pool, (15, 15))
# (Optional) Plot the mosaic using matplotlib.
import matplotlib.pyplot as plt
plt.imshow(mos)
# Save it.
from skimage import imsave
imsave(mos, 'mosaic.png')
```
Related Project
---------------
[John Louis Del Rosario](https://github.com/john2x) also has a
[photomosaic project](https://github.com/john2x/photomosaic) in Python. I
studied his code while I began writing version 0.1.0 of this project in 2012,
and there were similarities. Version 0.2.0 (2016) is a complete rewrite that
takes a fundamentally different approach.
===========
Assemble thumbnail-sized images from a large collection into a mosaic which,
viewed at a distance, gives the impression of one large photo.
Example
-------
```python
import photomosaic as pm
# Load a sample image
from skimage import data
img = data.chelsea() # cat picture!
# Generate dummy images covering the color gamut to use as a pool.
pm.generate_tile_pool('pool')
# Build the pool (analyze the dummy images).
pool = pm.make_pool('pool/*.gif')
# Create a mosiac with 15x15 tiles.
mos = pm.basic_mosaic(img, pool, (15, 15))
# (Optional) Plot the mosaic using matplotlib.
import matplotlib.pyplot as plt
plt.imshow(mos)
# Save it.
from skimage import imsave
imsave(mos, 'mosaic.png')
```
Related Project
---------------
[John Louis Del Rosario](https://github.com/john2x) also has a
[photomosaic project](https://github.com/john2x/photomosaic) in Python. I
studied his code while I began writing version 0.1.0 of this project in 2012,
and there were similarities. Version 0.2.0 (2016) is a complete rewrite that
takes a fundamentally different approach.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
photomosaic-0.2.2.tar.gz
(34.1 kB
view hashes)
Built Distribution
Close
Hashes for photomosaic-0.2.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f59b074564dcc1c8366d0dfd6c4f616a6cc127628094d69f4cad436778a25eb2 |
|
MD5 | b165f312ef8cabf2dee7786570fc5b64 |
|
BLAKE2b-256 | b7dd65768975c1e5062071c4d34f61f5b7e72225b1eea97dec8de9b6ac6cd376 |