[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

image creation

Martin Pirker

11/16/2004 3:33:00 PM

Hi...

Im pondering how to best create an image from a Ruby script.
1) a x*y size String comes to mind
easy manipulation
2) dump it out to a .pgm file
3) call pgm2jpg, pgm2png or something like that
4) serve link to file

For small images a "keep in memory" and call libjpg directly approach
comes to mind, for large images maybe via mmap?

Anyone ever did such things, pointer to example code?

thanks,
Martin
11 Answers

Stephan Kämper

11/16/2004 4:55:00 PM

0

Martin Pirker wrote:
> Hi...
>
> Im pondering how to best create an image from a Ruby script.
> 1) a x*y size String comes to mind
> easy manipulation
> 2) dump it out to a .pgm file
> 3) call pgm2jpg, pgm2png or something like that
> 4) serve link to file
>
> For small images a "keep in memory" and call libjpg directly approach
> comes to mind, for large images maybe via mmap?
>
> Anyone ever did such things, pointer to example code?

When I did some image manipulation I used RMagick/ImageMagick.
http://rmagick.rubyforge.org/...
http://www.imagemagick.org/i...

I had some very plain text files, with y lines and x characters in each
line. The chars where limited to single letters indicating red, blue,
green, white, black etc. colours.

Stephan

Brian Schröder

11/16/2004 4:58:00 PM

0

On Wed, 17 Nov 2004 00:33:17 +0900
Martin Pirker <crf@sbox.tu-graz.ac.at> wrote:

> Hi...
>
> Im pondering how to best create an image from a Ruby script.
> 1) a x*y size String comes to mind
> easy manipulation
> 2) dump it out to a .pgm file
> 3) call pgm2jpg, pgm2png or something like that
> 4) serve link to file
>
> For small images a "keep in memory" and call libjpg directly approach
> comes to mind, for large images maybe via mmap?
>
> Anyone ever did such things, pointer to example code?
>
> thanks,
> Martin
>

Imagemagick has a ruby binding and allows to do all kind of stuff.

See: http://rmagick.ruby...

Regards,

Brian

--
Brian Schröder
http://www.brian-sch...



Tim Hunter

11/16/2004 6:09:00 PM

0

On 16 Nov 2004 15:32:40 GMT, Martin Pirker <crf@sbox.tu-graz.ac.at>
wrote:

>
>Anyone ever did such things, pointer to example code?
>

The RMagick doc is online at http://www.simplesystems.org/RM...

Tobias Luetke

11/16/2004 8:08:00 PM

0

Be careful, the latest version of RMagick does not work with the
latest version of ImageMagick. Try to get imagemagick 6.0.*


On Wed, 17 Nov 2004 04:23:18 +0900, Tim Hunter <sastph@sas.com> wrote:
> On 16 Nov 2004 15:32:40 GMT, Martin Pirker <crf@sbox.tu-graz.ac.at>
> wrote:
>
> >
> >Anyone ever did such things, pointer to example code?
> >
>
> The RMagick doc is online at http://www.simplesystems.org/RM...
>
>


--
Tobi
http://blog.le...


Tim Hunter

11/16/2004 8:30:00 PM

0

On Wed, 17 Nov 2004 05:08:18 +0900, Tobias Luetke
<tobias.luetke@gmail.com> wrote:

>Be careful, the latest version of RMagick does not work with the
>latest version of ImageMagick. Try to get imagemagick 6.0.*
>
Correct. If you want to run with IM 6.1.3 or later, wait for RMagick
1.6.1, which will be available on RubyForge tonight or tomorrow.

Tobias Luetke

11/17/2004 11:46:00 PM

0

Thanks a lot tim, rmagick rocks


On Wed, 17 Nov 2004 06:38:17 +0900, Tim Hunter <sastph@sas.com> wrote:
> On Wed, 17 Nov 2004 05:08:18 +0900, Tobias Luetke
> <tobias.luetke@gmail.com> wrote:
>
> >Be careful, the latest version of RMagick does not work with the
> >latest version of ImageMagick. Try to get imagemagick 6.0.*
> >
> Correct. If you want to run with IM 6.1.3 or later, wait for RMagick
> 1.6.1, which will be available on RubyForge tonight or tomorrow.
>
>


--
Tobi
http://blog.le...


Tim Hunter

11/18/2004 12:13:00 PM

0

Tobias Luetke wrote:

> Thanks a lot tim, rmagick rocks
Glad you like it!

510046470588-0001

11/18/2004 6:51:00 PM

0


is there a ruby interface to ImageMagicks
or to the SDL or GDL libraries?

Klaus Schilling


Austin Ziegler

11/18/2004 7:01:00 PM

0

On Fri, 19 Nov 2004 03:51:06 +0900, klaus schilling
<510046470588-0001@t-online.de> wrote:
>
> is there a ruby interface to ImageMagicks
> or to the SDL or GDL libraries?

As far as I know, there's rmagick (ImageMagick binding) and RuDL (I
think?) -- there are bindings to both ImageMagick and SDL, though.
Check the RAA.

-austin
--
Austin Ziegler * halostatue@gmail.com
* Alternate: austin@halostatue.ca


Stephan Kämper

11/18/2004 7:49:00 PM

0

klaus schilling wrote:
> is there a ruby interface to ImageMagicks
> or to the SDL or GDL libraries?
>

As I posted earlier in the thread, there is
http://rmagick.rubyforge.org/...

Happy rubying

Stephan