From: "M. Edward (Ed) Borasky" Date: 2005-12-29T11:09:00+09:00 Subject: Re: Real-time image processing in Ruby Have a look at the Perl Data Language (PDL). This was designed to do high-performance image processing with a Perl user interface. I suspect the underlying C code could be interfaced to Ruby as easily as it was to Perl. If you're going to do serious number crunching of any kind in Ruby, you probably want to use C code to do the work. Ron M wrote: > Ilmari Heikkinen wrote: > >> On 12/29/05, John Koschwanez wrote: > > > > >>> - Is anyone using pure Ruby to process images real-time? RMagick is >>> too >>> limited for my applications. I doubt Ruby would match the speed of C, >>> but it might be fun to try. >> >> >> Correct me if I'm wrong, but image processing is one of those things >> that plays directly into the weaknesses of the current Ruby >> implementation. > > > I disagree. Image processing is an area where even in Java/C#/C/etc > you're probably better off using highly tuned matrix libraries than > rewriting such basic operations from scratch; and Ruby has a pretty > good matrix library (NArray). > > And under the assumption that regardless of the language most of > the CPU time will be used inside such a matrix library, the > overhead of the language wrapping it shouldn't matter much. > > > > If you do find yourself writing ruby loops to touch large sets > of individual pixels, however, you should probably consider > extending NArray in C instead - hopefully with some pretty > general purpose function so many ruby algorithms could make > use of the same extensions. (for example, I'm not sure if > NArray has a nice way of specifying a mask to only process > part of an image). > > - R > > > -- M. Edward (Ed) Borasky http://linuxcapacityplanning.com