From: Tim Hunter Date: 2007-06-11T05:54:31+09:00 Subject: Re: [QUIZ][SOLUTION] Mexican Blanket (#127) Justin Ethier wrote: > And to draw a JPEG we get a bit fancier, but its the same basic idea. > There > must be a better way to code this, because it takes much too long to run. Nice solution! Regarding the speed, see my earlier reply to Jesse Merriman. Instead of drawing a pixel at a time, create an array of Pixel objects and then use import_pixels or store_pixels to "draw" a row at a time. For that matter, both of these methods can handle arbitrary rectangles so you can create as many rows as you want and stow them in the image all at once. You could build the whole image in memory if that's what you wanted. -- RMagick OS X Installer [http://rubyforge.org/projects/rmagick/] RMagick Hints & Tips [http://rubyforge.org/forum/forum.php?forum_id=1618] RMagick Installation FAQ [http://rmagick.rubyforge.org/install-faq.html]