2

I want to create a multi-image collage poster like this one:

enter image description here

Anybody know how to program it in php?

Tomas
  • 57,621
  • 49
  • 238
  • 373
  • 7
    Yes, many do. What problem are you having? Have you tried anything yet? – Brad Mar 15 '12 at 16:09
  • I am about to build an app that can create a collage from a collection of images. So I need an idea, how to do it. – Sukanyeah Krishna Mar 15 '12 at 16:13
  • You posted one option in your tags, ImageMagick. Another option is GD. Is your question on loading photos? Resizing photos? Creating new images? Copying from one image to the other? Drawing alpha-gradient border? **What specifically is your question?** Nobody can help you if you don't know what your question is. – Brad Mar 15 '12 at 16:14
  • I would like to use GD or Imagemagick. I have a collection of images, the numbers may vary. I need to make an auto adjusted collage of these images into a single image using a php program with the help of GD or imagemagick. – Sukanyeah Krishna Mar 15 '12 at 16:16
  • So you're just looking for a general "Where do I start?" type of answer, then? What features of the image you linked are you hoping to replicate? Like, just putting a bunch of square photos together would be easy, but placing them at all different shapes and sizes like that could get tricky depending on your exact needs. – Rick Mar 15 '12 at 16:17
  • Here is an exact demo of the application http://www.pixurwall.com/collageposter/web/albums.php I just need to know how can i arrange the pictures dynamically to this kind of collage. – Sukanyeah Krishna Mar 15 '12 at 16:22
  • Brad You please take a look at this pixurwall.com/collageposter/web/albums.php before you make loose comments like the above one. I know those stuffs, I am asking this question to an Imagick expert. Not to a StalkOverflow expert. If you don't know how to do it, please don't bother to reply – Sukanyeah Krishna Mar 18 '12 at 04:20
  • @Brad There is a particular function with an algorithm to adjust it automatically. I am looking 4 that simple piece of info. I am not asking you to create the complete application for me. :( – Sukanyeah Krishna Mar 18 '12 at 04:21

1 Answers1

5

There are lots of examples and tutorials about combining multiple images into one using GD or ImageMagick.

The image libraries offer you the ability to create, copy, resize, rotate, and manipulate image data; however they don't just automagically know what sort of a montage you want. You have to define your criteria and think about how to go about instructing a program to arrange the photos how you want.

  • Are the input images of different sizes/aspect ratios/resolutions?
  • Are the input images already rotated and cropped correctly?
  • Should all images in the resulting image be of the same dimension? The example you linked includes images of different sizes, but they share common borders, which is a technique that will require some analytical skill to determine how images should fit together.
  • What happens if there are many images? Does the output image scale up to compensate? Do the tiled images shrink to fit? Does the program create additional montage "pages?"
  • Are the borders always going to be the same color/thickness/etc? Should there be options to alter them? What about spacing between images?

I ask all these questions as examples of things you need to define for your program. (And also to clarify your thoughts when asking others for help.)

If you're learning the image library functions, you should start with a simple task: take two images and combine them into one. You have to at least do this before you can hope to add the sort of complexity that would go into generating mosaics like the one you cited as an example.

JYelton
  • 35,664
  • 27
  • 132
  • 191