title: Virtual gridding/resizing of image collage in PHP
body: <p>I'm looking for a finshed solution or possibly some math/algorithms for creating a big image collage out of smaller product pictures?
  I know how to do it in a square fashion, from same sized pictures with gd/imagemagick but I'd like to have some variation built in.</p>
  
  <p>For example, some of the pictures might be slightly taller, and if all are the same size and square - i might want 1 of them take up more space, just to mix up the design. keeping it interesting.</p>
  
  <p>the more i think about this the harder it seems to do with a formula. having predefined "templates" for all the possible scenarios isn't going to work since the amount of pictures could vary from just 1 (no work needed) to 10+.</p>
  
  <p>i'm not looking for any rotation or special effects, just the images in a grid with maybe some spacing inbetween and no overlapping.</p>
  
  <p>any ideas how to accomplish this, and is there really nothing ready to go out there?</p>