There is no build in functionality in montage that does a 'best fit' (http://www.imagemagick.org/Usage/montage/#null, read the remarks). You probably need an algorithm like this 'http://www.codeproject.com/Articles/210979/Fast-optimizing-rectangle-packing-algorithm-for-bu' and create it yourself. It might be a nice feature to add to ImageMagick so I will put it on my TODO list and play with it when I have nothing to do :) (this does not happen that often).
↧