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 space
Well looking at it if the number is prime you want to have 1 row with x columns where x is the prime number. Else if the number is a perfect square the rows would be the square root of the number by the square root of the number (9 == 3x3) . Else factor the remainder.