Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a collection of images and an image that I want to generate from that collection.

What software is there available for Ubuntu for generating a mosaic image? How to do it?

share|improve this question
add comment

4 Answers

A very nice program for doing all sorts of photomosaics is in the repositories and is called metapixel.

Install from software-center or open terminal and run

sudo apt-get install metapixel

The readme is available at the github page or from /usr/share/doc/metapixel/README.gz when it is installed, and it notes that

Metapixel is a program for generating photomosaics. It can generate classical photomosaics, in which the source image is viewed as a matrix of equally sized rectangles for each of which a matching image is substitued, as well as collage-style photomosaics, in which rectangular parts of the source image at arbitrary positions (i.e. not aligned to a matrix) are substituted by matching images.

The readme contains full instructions for use, but a useful youtube tutorial for Ubuntu exists, as well as a sort of online gui with which you can construct your command-lines.

Nevertheless, here's an example of how I used metapixel to create a classic photomosaic.

There is a perl script that comes with metapixel called metapixel-prepare, and this is very useful for generating the photo tiles that your mosaic image will contain. Options can be found with metapixel-prepare --help, but basically you just have to specify your folder of pictures and your metapixel library folder.

1) This library folder needs to be created before you run the metapixel-prepare command, so run in terminal

mkdir metapixel_library

2) Then to generate the tiles from the selected folder, the minimum command would have the form:

metapixel-prepare ~/location/of/my/pictures/ ~/metapixel_library 

If you wish metapixel-prepare to recurse through the folders you have to specify -r; if you want the tiles to be a specific size (other than the default 128x128), specify at the end of the command, for example, --width 80 --height 80.

As an example, the command I used was:

metapixel-prepare -r ~/Pictures/canon/metapixel ~/metapixel_library --width 80 --height 80

3) To construct your photomosaic you must specify the location of this library of tiles, specify the image to be metapixelled and designate an output file (which must be a .png file). The input jpg can be any kind of picture and any size (see note on scale below).

I used the following commands in my case:

metapixel --library ~/metapixel_library --metapixel /home/mike/Pictures/canon/2012_02_05/img_0372.jpg output.png

The full options for metapixel can be found by entering metapixel --help, and sometimes you may need to use --scale to increase the size of the output image. I didn't in the case above as my input picture was already 4000x3000.

The results will differ according to which pictures you have chosen for your library and your input picture.

The process will also take a while if you select thousands of pictures for the mosaic, and will also consume a fair bit of memory.

Below is a photomosiac created with my own photos (using the commands above):

enter image description here :

share|improve this answer
add comment

You can try pixelize. To install search for pixelize on the Software Center or type on Terminal:

sudo apt-get install pixelize

Description from it's man page:

pixelize is a program that will use many scaled down images to try to duplicate, as closely as possible, another image.

share|improve this answer
add comment

Try Andrea Mosaic under Wine, which works perfectly in a GUI and creates awesome Mosaics based on your pictures.

enter image description here

You simply choose the image that you wish to represent with pictures, add the galleries of pictures that you wish to use for that purpose and with minimal adjustments you'll be able to create amazing images like this one:

enter image description here

Low resolution image, the mosaic is too big. The original can be seen in my profile's picture.

From the site:

On Linux you can run AndreaMosaic successfully with the free Wine Emulator which is available on most linux distributions using the standard installer (Synaptics, etc). After you installed Wine download and execute the AndreaMosaic Windows Setup. Click Here for more details about AndreaMosaic under Wine.

Good luck!

share|improve this answer
add comment

Just make it online using websites like http://mosaically.com

share|improve this answer
1  
While the web-service might give the wanted result. The question is if there is software available for Ubuntu. –  MadMike Oct 21 '13 at 4:21
1  
While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. –  Radu Rădeanu Oct 21 '13 at 7:17
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.