I have about 50 rectangular pieces of paper, with dimensions between 1 and 5 inches and different "aspect ratios." I'd like to fit them all inside the smallest rectangle possible. Additional constraints are that each rectangle should not be rotated (imagine they all have an arrow on them, and the arrow must be pointing up) and no rectangle be cropped or resized.

enter image description here

I've tried approaching this from two angles. First was digital collage software. However, it seems that because collage software are used for digital collages, most if not all don't have options to preserve image size. Many seemingly don't even have options to disable automatic cropping.

Second, I've looked into nesting software used for CNC and laser cutters. This seems more promising, but most do not have an option to disable rotation, most are priced for commercial use by big companies, and many require knowledge of CAD software (no .svg importing).

What software (either standalone or plugin/scripts for Photoshop or Illustrator) could help me with this problem? I'm aware of questions like this and this; I'm hoping that better solutions exist for shapes that are irregular, but all rectangular.

New contributor
wavedash is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
  • Interesting. May I ask what this is for? – Wolff Nov 21 at 1:31
  • If no image can be cropped or resized or rotated, then to be honest, I don't see how it would be possible to get such an exact fit inside a rectangle. You can try experimenting using SVG Nest. You can set the rotations to 0 in the settings. – Billy Kerr Nov 21 at 8:10
  • Even after 300 iterations with SVG Nest, the best you can probably get is something like this – Billy Kerr Nov 21 at 8:16
  • Also note SVG Nest only works with vector objects – Billy Kerr Nov 21 at 8:21
  • @BillyKerr I'm not sure what the rotation setting on SVGnest does, but it does not prevent rotation from the original orientation. I'm guessing what it does is modify the number of rotations between iterations. i.imgur.com/ojIBkwx.png – wavedash Nov 21 at 20:08

Check out this page (direct link to zip here). It's pretty old, but it should do the job. Use the "BatchPicturePackageNoRotate.jsx" script.

| improve this answer | |
  • I'm not sure I understand how this script works. The first thing it asks for is a template; how do I generate the optimal template? – wavedash Nov 21 at 7:42
  • @wavedash read through the page's section for "Photo collage and mockup tools". It explains how to build a template, and offers some templates for download. – Joseph Massaro Nov 21 at 15:16
  • I'm pretty sure I know how to manually prepare a template, and then automatically populate it. However, I'm not seeing any documentation on how to automatically make a template. – wavedash Nov 21 at 20:18
  • I see the problem now - I don't think this script will do what you're looking for. Best of luck. – Joseph Massaro Nov 22 at 15:55

Your Answer

wavedash is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.