An algorithm that joins images in an enclosing rectangle with an area as small as possible.