ideamonk / pymos Goto Github PK
View Code? Open in Web Editor NEWCreates beautiful mosaic for an image using a set of thumbnails
Home Page: https://ideamonk.github.io/PyMos
License: BSD 2-Clause "Simplified" License
Creates beautiful mosaic for an image using a set of thumbnails
Home Page: https://ideamonk.github.io/PyMos
License: BSD 2-Clause "Simplified" License
Traceback (most recent call last):
File "./test", line 59, in
new_colormap=args.new_colormap)
File "build/bdist.linux-i686/egg/pymos/core.py", line 91, in build_mosaic
File "build/bdist.linux-i686/egg/pymos/core.py", line 35, in build_colormap
File "/usr/lib/python2.6/site-packages/PIL-1.1.7-py2.6-linux-i686.egg/Image.py", line 1980, in open
raise IOError("cannot identify image file")
IOError: cannot identify image file
how long does the program take? does the program take a longer time if the input images have large size or? What other factors affect the program's speed or the quality of the final mosaic?
** todo in some free time sometime later.
Any chance if it is somehow possible to retrieve a list of the actual images used to build the mosaic? I'd like to be able to somehow move my mouse over the mosaic image and be able to click each and every image in the mosaic and then visit for instance a page with some background info on that very image.
I already looked around in the sourcecode for a sec but didn't find a solution right away.
i have the following directory structure:
/dir
-- test.jpg
-- collection/
-- small_img1.png
-- small_img2.png
-- and so on...
i invoke pymos using: me@mylaptop: ~/dir$ pymos test.jpg output.png ./collection/
this is what i see :
0
INFO:PyMos:Building index...
INFO:PyMos:Color Index built
INFO:PyMos:Generating Mosaic...
Traceback (most recent call last):
File "/usr/local/bin/pymos", line 5, in
pkg_resources.run_script('PyMos==0.6', 'pymos')
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 467, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1200, in run_script
execfile(script_filename, namespace, namespace)
File "/usr/local/lib/python2.7/dist-packages/PyMos-0.6-py2.7.egg/EGG-INFO/scripts/pymos", line 59, in
new_colormap=args.new_colormap)
File "/usr/local/lib/python2.7/dist-packages/PyMos-0.6-py2.7.egg/pymos/core.py", line 128, in build_mosaic
if (colormap[match[2]][2] == None): # has not been resized yet
IndexError: list index out of range
my test.jpg is 256x256 and all collection images are 75x75
from @meshaabi
nah i have 2.5 gigs ram free.. source is 500 images.. worked with -z 2
btw was checking out the src.. you are checking every pixel on the image.. the index builder died when i tried to use the 7.1 megpix pics from my camera..
maybe could check pixel blocks or first generate a thumbnail itself before getting to average pixel counting
while input and output images work fine even on bigger sizes,
it was an assumption that users would supply a folder with real small thumbnails as collection param.
If some one passes a directory full of real digicam pics as collection, in most cases it freezes the user's system.
Solution - precalculations based on source dimensions and zoom factor
$ pymos logo.jpg output.png images/
0
INFO:PyMos:Building index...
Traceback (most recent call last):
File "/usr/local/bin/pymos", line 5, in
pkg_resources.run_script('PyMos==0.6', 'pymos')
File "/usr/local/lib/python2.6/dist-packages/setuptools-0.6c9-py2.6.egg/pkg_resources.py", line 448, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/local/lib/python2.6/dist-packages/setuptools-0.6c9-py2.6.egg/pkg_resources.py", line 1173, in run_script
exec script_code in namespace, namespace
File "/usr/local/lib/python2.6/dist-packages/PyMos-0.6-py2.6.egg/EGG-INFO/scripts/pymos", line 59, in
File "build/bdist.linux-x86_64/egg/pymos/core.py", line 82, in build_mosaic
File "build/bdist.linux-x86_64/egg/pymos/core.py", line 43, in build_colormap
TypeError: 'int' object is unsubscriptable
Ran into a small issue with the build_mosaic() function in core.py, line 76:
files = glob.glob(os.path.join(collection_path, '*.jpg'))
My files ended with the extention "*.JPG". The traceback or the error I got was the following:
Traceback (most recent call last):
File "/usr/local/bin/pymos", line 5, in <module>
pkg_resources.run_script('PyMos==0.6', 'pymos')
File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 467, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 1200, in run_script
execfile(script_filename, namespace, namespace)
File "/usr/local/lib/python2.6/dist-packages/PyMos-0.6-py2.6.egg/EGG-INFO/scripts/pymos", line 59, in <module>
new_colormap=args.new_colormap)
File "/usr/local/lib/python2.6/dist-packages/PyMos-0.6-py2.6.egg/pymos/core.py", line 130, in build_mosaic
if (colormap[match[2]][2] == None): # has not been resized yet
IndexError: list index out of range
which was rather unhelpful.
Two points:
~
musically_ut
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.