title: Calculating # or Rows and Columns
body: <p>I have a # of images that I'm stitching together into a sprite sheet, how can I calculate the number of rows and columns to fit equally in an even rectangle (no blank spaces)?</p>
  <p>Some examples:</p>
  <blockquote>
  <p>6 images should become 2 rows, 3 columns</p>
  <p>7 images should become 1 row, 7 columns</p>
  <p>8 images should become 2 rows, 4 columns</p>
  <p>9 images should become 3 rows, 3 columns</p>
  <p>10 images should become 2 rows, 5 columns</p>
  </blockquote>
  <p>Hopefully that helps explain it.</p>
  <p>Ideas?</p>