From: Charles Comstock Date: 2004-02-03T09:30:08+09:00 Subject: Re: graphics lib? Simon Strandgaard wrote: > On Sun, 01 Feb 2004 16:18:50 -0600, Charles Comstock wrote: > > >>Simon Strandgaard wrote: >> >>>On Sun, 01 Feb 2004 02:12:43 +0900, Alwin Blok wrote: >>> >>> >>> >>>>Hello, >>>> >>>>What would be the best choice for 2d vector graphics with ruby? >>>>My needs are as follows: >>>>2D vector (SVG/ pdf/ postscript like), Animation, Offscreen rendering. >>> >>> >>> >>>I can recommend RMagic. >>>http://rmagick.rubyforge.org/ >>> >>>Don't know about animation though. >>> >>> >>>You may see what I have made using RMagick, here: >>>http://aeditor.rubyforge.org/softwrap.html >>> >>>-- >>>Simon Strandgaard >> >>I have used RMagic in the past, but it doesn't quite seem suited to per >>pixel editing. I was trying to do an AI project of RedEye detection for >> a class, and I did succeed to use it but I had to add a couple methods >>to more easily edit individual pixels. It just didn't seem to be really >>set up to do per pixel calculations or modifications very nicely. I was >> curious if anyone else has suggestions on what would be most >>appropriate for that? > > > > It's possible with RMagick.. get/set pixel methods :-) > http://www.simplesystems.org/RMagick/doc/image.html#Image.get_pixels > > > -- > Simon Strandgaard > Right I have used that function it's just very cumbersome, it would be much easier to directly edit the values in the real array they are in. Exporting a pixel array is really not a very efficient operation, not to mention the need to reimport them later. Not to mention the fact it returns a flat array which while it's easy to write an accessor that 2d's it, it still is not particularly friendly towards doing image analysis. Charlie