From: Ron M Date: 2005-12-29T10:06:25+09:00 Subject: Re: Real-time image processing in Ruby 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