I want to achieve the effect shown in the images attached. Given certain items, fit them into a shape (box or something else), with the option to resize the items or not.
I know there has to be some algorithm related, but I don't know where to start looking.
Any keyword, wikipedia article, or pdf will be welcome.