CLI, Pythonista (iOS App), and Siri Shortcut to combine 3 or more images into a collage, maintaining image aspect ratios and distributing images evenly over collage rows.
pass multiple pointers to p's width (p.width * m) to the linear_partition function
if the pointers end up on separate rows then as long as they're far-left or far-right in the row, the rest of the row will fit in perfectly
This is nice, but restricts p to the left or right columns.
If you instead
decided where p goes ahead of time, you could populate the remaining portion of the affected rows using more calls to linear_partition.
But this means that you need to know something about the resulting width of the collage, which currently is undetermined (it's the minimum width of any of the rows output by linear_partition).
The collage aspect ratio is somewhat predictable (it's very close to the average aspect ratio of the images).
If I took the total width then I could used the average aspect ratio to approximate the resulting width of the collage, which then allows me to know the width of p when on multiple rows as well as the widths of the new subrows to the left and right of p.
Rather than selecting images within Pythonista, would like to be able to select images in another app and send them to the script vis the iOS Share Sheet.
First of, I really appreciate the work yo have done. It works great.
The only issue I have is with the resolution.
I have tried setting the image sizes in the arguments to very large values, but nothing seems to increase the resolution of the images in the collage. Delimitry's collage_maker produced a higher quality image.