Before you start out using Macbeth and compile anything, read this file. There is really a lot to do before you can get cool stuff out of the program and by using five minutes reading this README you can save many hours of frustration. BLAH BLAH This is the Macbeth software package. It is a neat tool if you plan to make mosaics out of pictures and photos. It was inspired by a Newsweek article about Silvers who first started making Photomosaics (tm). He did not want to share his artistic tool, so I borrowed the general idea (from the Newsweek article, I have never seen any code or algorithms) to make this artistic tool available to everyone. If only one painter had a brush we would never have had so many great paintings, and if only one person have a mosaicking tool we may lose our chance to actually get a great many snazzy mosaics. To make the tool "free", the software, its code and documentation has been copylefted under the GNU General Public License (in the file COPYING): COPYRIGHT/DISCLAIMER: Macbeth v0.1 Copyright (C) 1998 Stig Erik Sandø This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation version 2 or later. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. MORE BLAH BLAH The program has a few algorithms and techniques to select the best fitting picture for a specific tile. Before you panic after your first few tries because it's not even close to what you want it to look like, take this into consideration: * Silvers (the guy from the media) uses a database of more than 100k pictures. I have used 1400 pictures, which Macbeth also flips, thereby making it 2800, still way short of those seen in the media. With 1400 pictures I made a Christopher Robin and Pooh picture though, which looks fantastic on a wall in poster size. * Pictures you make mosaics of should at least be 2000x2000 pixels, and depending on the size of your picture-database have appropriate tilesize. With my 1400 pictures I can use 30x30 tilesize, but I would prefer at least 40x40 but I will need at least 20k pictures for that I think. When you first start, try 20x20 and increase gradually. Remember that 30x30 is more than twice as big as 20x20 :-) * Not all pictures and photos look good when mosaicked, at least when you don't have a big picture database. Go for rather sharp differences, which will be somewhat blurred and get an impressionistic look. If you start out with a blurry picture you will lose the small differences your eye can perceive, but the software can't manage to give you those. Pictures with few small details are also recommended. * Cartoon-characters are maybe what you should start testing on to test your picture database and how much of it the structure-checking manages to utilize. * Clean colour-checking is slow and seldom, if ever, gives good effect. This is contrary to what everyone thinks when they start. Yes, it is a matter of taste, but by structure-checking you get results faster and imho they look much "better" (or closer to a mosaic at least :-). * Forget the notion that you can get "perfect" mosaics.. that has never been the intention of the software. I wanted to make a tool which creates pictures which I will like, if you want them different, change what you need in the code. Artists who use stock paint are usually failures, learn to mix your own paint. * If you decide to make a mosaic of your favourite moralist politician who tells everyone how they should live, out of hardcore gay porn-pictures, don't blame me, though I like the idea. Making a black-white picture of Bill Gates out of pictures of old german nazis "out to conquer the world" would probably also be a big success in the right community :-) TECHNICAL STUFF You will need the following to compile and use Macbeth: * A C++ compiler (has been tested with gcc 2.7.x and SGI MipsPro 7.2) * GNU Make (don't even try standard make, like SGI Make) * The Qt Library (http://www.troll.no/) * libjpeg (is part of most std Un*x dists) * gdlib (Boutell's gif-manip. library, is included) From my part it has only been used on my 486 running Linux 2.0.32 and with glibc, and on the SGI O2 in my office. The more memory you have,m the happier Macbeth will be. The faster processor you have, the happier Macbeth will be. Minimum memory is 16 Meg I think, but for speed it relies on memory instead of disk access. Memory is cheap nowadays so it should be no problem. INSTALL AND COMPILE Simple version (where gmake is GNU make): $ cd gd $ gmake $ cd .. $ gmake depend $ gmake You are expected to edit Makefiles as needed. Basic choices for Linux and IRIX should be apparent. BASIC USE First you will need to create a picture database and there are two basic approaches: 1. ./myreadpic file1.jpg file2.gif *.jpg *.gif .. The program reads in the command line and creates the stats.dat file with the picture-database, that is a database with _some_ information about the pictures, not the pictures themselves. The pictures must be available when running mymacbeth too. 2. /bin/ls -1 *.jpg > datapic.dat /bin/ls -1 *.gif >> datapic.dat /bin/ls -1 somedir/*.jpg >> datapic.dat ... let datapic.dat have all filenames, one on each line ./myreadpic This approach avoids limits on command-line, and lets you edit which pictures you want in the database somewhat easier than the other approach. Provided you now have a huge stats.dat file which is a binary file with info on the pictures, it is time to generate a mosaic. The command is quite simple: ./mymacbeth Most of the user-interface should be intuitive and easy to understand. Basically it is selecting options and values and then 'Start Processing'. The 'Split' Button is when you wish to split resulting bmps, so just select a bmp-file as infile and click the button and you will get a popup when it is done. Depending on how much you trust your algorithms, you can choose an alternative size which for every tile selects the closest ones in case you're not too happy with it all. When the mosaic is generated, click the right mouse button on a tile and select a new picture for it. Some other options are also available when you click the right mouse button. TRICKS 1. Remove all borders from pictures you use or they will screw the algorithms. 2. Don't make the pictures in the picture database too large, make them "small" (100x100 to 500x500) so they get loaded quicker and rescaled quicker. 3. There is no need to make pictures in the database quadratic or all the same size, the program won't run much faster (if at all). 4. Load the picture in the background to get closest 256 colours and to see it progress (fascinates most people) THE CODE The code is not a pinnacle of anything and is untidy, not debugged, not the fastest and probably leaks memory. It is a dev. version to prove a concept and not an App made for John Does and other lusers. It is copylefted so other people can use it and improve it. The code makes some assumptions that may not be valid, though I have not fixed all of them yet. E.g the code assumes that sizeof(int) >= 4 and that you use a flat memory model. FUTURE IMPROVEMENTS * Use jpeg and 24-bit colour all the way * Support black/white or grayscale pictures * Write output to something else than bmp, ie jpeg * Try to make sure tiles keep more details when printed * Improve the algorithms.. (big surprise :) WHO, WHAT AND WHEN The code was made by Stig Erik Sandø in a few days because it was too boring to read for an exam. Most of the work was getting a picture database, which I got invaluable help from Cass Jacobs to do. Without the net axx, fancy SGI machines and nice printer facilities of the Art History Dept at the Univ. of Bergen where I have worked and will work some time again after my exam, it would have been much harder doing this. I will need a new job in september.. I would love to hear of you using Macbeth to create cool stuff or if you improve it. I will also answer questions directly related to the code, not how you use make and install it and etc. You can contact me at or and I think I still have a homepage at http://www.ii.uib.no/~stig/