ImageMagick to create collages based on custom algorithms?
Posted: 2014-03-04T09:20:35-07:00
Hi, I recently started developing an application which is supposed to select images randomly from a folder, make a collage out of them using a custom algorithm, and then output the collage (the final image should be in the user's current desktop resolution). I originally started this project using SFML, but have found that it is unable to handle images larger than 2048x2048 (hardware limitation supposedly, but ThetaWall seems to have no such restrictions). Anyways, someone in another forum recommended I use ImageMagick. However, I've been reading a lot of documentation and I'm having trouble figuring out where to even begin. Could someone please point me in the right direction here? How would you accomplish this? Basically I just need a way to scale images and apply them to a canvas at specific x,y coordinates. I also need a way to determine height/width of images I am using after I scale them so that I know where to place the next image when I am tiling.
Here's what I want the output to look like (I created this using the Windows application ThetaWall)
http://i199.photobucket.com/albums/aa21 ... g~original
You can even see the algorithm it is using just by looking at the image carefully. First, it placed one image in a random corner (top-right in this case) and scaled it towards the upper limit specified in the config file. Then, it tiled images across starting from the bottom-right corner, scaling everything to fill any empty space. The last image doesn't fit perfectly, so it centered the image relative to the previous image and scaled it to the edge. Then it went to fill in the remaining space and was only able to fit 2 images, which it decided to center relative to the large image.
Here's what I want the output to look like (I created this using the Windows application ThetaWall)
http://i199.photobucket.com/albums/aa21 ... g~original
You can even see the algorithm it is using just by looking at the image carefully. First, it placed one image in a random corner (top-right in this case) and scaled it towards the upper limit specified in the config file. Then, it tiled images across starting from the bottom-right corner, scaling everything to fill any empty space. The last image doesn't fit perfectly, so it centered the image relative to the previous image and scaled it to the edge. Then it went to fill in the remaining space and was only able to fit 2 images, which it decided to center relative to the large image.