Joining lots of small images into one large image

Discussion in 'Ruby' started by Azalar ---, Mar 28, 2010.

  1. Azalar ---

    Azalar --- Guest

    I have 40 small images that are 70 x 70 pixels and they are numbered
    like 1.jpg, 2.jpg etc up to 40.jpg

    I want to merge these into 1 large image strip 2800 x 70 pixels in Ruby
    code but am not sure of the best approach to this.

    Can anyone point me in the right direction for this or better still a
    snippet of code?

    Thanks

    Az
    --
    Posted via http://www.ruby-forum.com/.
     
    Azalar ---, Mar 28, 2010
    #1
    1. Advertising

  2. On Mar 28, 2010, at 3:06 PM, Azalar --- wrote:

    > I have 40 small images that are 70 x 70 pixels and they are numbered
    > like 1.jpg, 2.jpg etc up to 40.jpg
    >
    > I want to merge these into 1 large image strip 2800 x 70 pixels in
    > Ruby
    > code but am not sure of the best approach to this.
    >
    > Can anyone point me in the right direction for this or better still a
    > snippet of code?
    >
    > Thanks
    >
    > Az
    > --


    That's exactly what the 'montage' command from ImageMagick does. As
    long as
    using:
    images = (1..40).map{|i| "#{i}.jpg"}
    system("montage #{images.join(' ')} +page -tile 40x1 -geometry
    70x70+0+0 #{outfile}")
    counts as "Ruby code", then you're all set!

    -Rob

    Rob Biedenharn http://agileconsultingllc.com
     
    Rob Biedenharn, Mar 28, 2010
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Stuart
    Replies:
    3
    Views:
    451
    Joe Smith
    Aug 19, 2004
  2. Dave Stallard
    Replies:
    6
    Views:
    311
    John Harrison
    Jun 1, 2007
  3. brad
    Replies:
    9
    Views:
    371
    Bruno Desthuilliers
    Jun 19, 2008
  4. Stuart

    Help: joining 5 LARGE text files

    Stuart, Aug 19, 2004, in forum: Perl Misc
    Replies:
    7
    Views:
    110
    Joe Smith
    Sep 16, 2004
  5. coolneo
    Replies:
    9
    Views:
    189
    coolneo
    Jan 30, 2007
Loading...

Share This Page