From: ara.t.howard@... Date: 2005-12-29T11:17:42+09:00 Subject: Re: Real-time image processing in Ruby On Thu, 29 Dec 2005, Ron M 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. absolutely. unless you start looping... this is the tradeoff for high-level languages. > > 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). and a combination of NArray and RubyInline and/or ruby dl would make for very rapid prototyping indeed. -a -- =============================================================================== | ara [dot] t [dot] howard [at] noaa [dot] gov | all happiness comes from the desire for others to be happy. all misery | comes from the desire for oneself to be happy. | -- bodhicaryavatara ===============================================================================