SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Evangelist
    Join Date
    Jan 2002
    Location
    Scotland, UK
    Posts
    530
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    imagemagick: How can I mosaic 9 JPGs into one JPG?

    Hello folks,

    Wondering if GD or Imagemagick can do this.

    I want to take 9 files from my server and create a grid of them, reduced in size to display as a gallery header of sorts for instance:



    Is this possible at all?

    Many thanks,

    Rikki

  2. #2
    SitePoint Mentor silver trophy
    Rubble's Avatar
    Join Date
    Dec 2005
    Location
    Cambridge, England
    Posts
    2,210
    Mentioned
    74 Post(s)
    Tagged
    3 Thread(s)
    Check this page out 2nd from the bottom, the bit of code creates the thumbnail images, adds a frame and shadow, spaces the images and makes an image map - from memory as it was a while ago since I did this

    http://www.rubblewebs.co.uk/imagemagick/mosaic.php

    This reads all the images from the folder to create the "index" or you can add individual images:
    PHP Code:
    exec("/usr/local/bin/montage image1.jpg image2.jpg image3.jpg image4.jpg image5.jpg image6.jpg -tile x3  mosaic/montage.jpg"); 
    I have also done it with php using an array and looping through it.

    The code can be modified and there are other methods you could use like -append or just create the images with Imagemagick and locate them on the page with html.

    So many choices and options !!

  3. #3
    rajug.replace('Raju Gautam'); bronze trophy Raju Gautam's Avatar
    Join Date
    Oct 2006
    Location
    Kathmandu, Nepal
    Posts
    4,013
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    By fixing the thumbnail sizes, and of course with the help of co-ordinates we can do it using GD too. I had done already about it.
    Mistakes are proof that you are trying.....
    ------------------------------------------------------------------------
    PSD to HTML - SlicingArt.com | Personal Blog | ZCE - PHP 5

  4. #4
    SitePoint Evangelist
    Join Date
    Jan 2002
    Location
    Scotland, UK
    Posts
    530
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks guys, got it all sorted out!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •