Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Joining lots of small images into one large image

Reply
Thread Tools

Joining lots of small images into one large image

 
 
Azalar ---
Guest
Posts: n/a
 
      03-28-2010
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/.

 
Reply With Quote
 
 
 
 
Rob Biedenharn
Guest
Posts: n/a
 
      03-28-2010
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
http://www.velocityreviews.com/forums/(E-Mail Removed)




 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Looking for lots of words in lots of files brad Python 9 06-19-2008 07:59 AM
question: multiple images into one large image (like panorama stitching) RJB Digital Photography 8 06-20-2007 05:03 AM
lots of little mallocs or one big one? (somewhat naive) Dave Stallard C++ 6 06-01-2007 06:30 AM
Downloading lots and lots and lots of files coolneo Perl Misc 9 01-30-2007 02:34 PM
HELP: Joining 5 large text files Stuart Perl 3 08-19-2004 06:23 PM



Advertisments