image creation

M

Martin Pirker

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
 
S

Stephan Kämper

Martin said:
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/index.html
http://www.imagemagick.org/index.html?

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
 
B

Brian Schröder

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.rubyforge.org/

Regards,

Brian
 
T

Tobias Luetke

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

Tim Hunter

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.
 
T

Tobias Luetke

Thanks a lot tim, rmagick rocks


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.
 
K

klaus schilling

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

Klaus Schilling
 
A

Austin Ziegler

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
 
G

gabriele renzi

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

RUDL and ruby/sdl are bindings to SDL.
rmagick for ImageMagick
I think GDL means the GD library for graphs/images, there are bindings
for that, too.
Looking on RAA (raa.ruby-lang.org ) should provide you links to get 'em
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,161
Messages
2,570,892
Members
47,430
Latest member
7dog123

Latest Threads

Top