danielballan / photomosaic

Assemble thumbnail-sized images from a large collection into a tiling which, viewed at a distance, gives the impression of one large photo.
http://danielballan.github.io/photomosaic/docs/
BSD 3-Clause "New" or "Revised" License
57 stars 13 forks source link

v0.2.0 rewrite #9

Closed danielballan closed 8 years ago

danielballan commented 8 years ago

There is more work to do, but the core functionality is working. Ready for some initial comments if you have time to look, @dlu.

import photomosaic as pm

pm.set_options(colorspace='sRGB1')  # effectively turning off fancy colorspace stuff for now
pm.set_options(imread={'plugin': 'matplotlib'})  # the default reader fails on GIFs for some reason

# Load a sample image
from skimage.io import imread
img = imread('examples/dan-allan.jpg')

# 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 the mosiac.
mos = pm.basic_mosaic(img, pool, (15, 15))

import matplotlib.pyplot as plt
plt.imshow(mos)

Features from old implementation still missing:

Features that should now be easier to add:

danielballan commented 8 years ago

If you are looking at the example above via email, note that I have edited it in place on github.

danielballan commented 8 years ago

I merged this into master and tagged v0.2.0 to get this up on PyPI so it is installable with pip: https://pypi.python.org/pypi/photomosaic

That's not to say we couldn't still do a major re-think on this when you get a chance to look at it. I assume more tags are coming soon.