Lightweight way to create jpeg files?

M

Mike Nelson

Is there an easy lightweight way to dynamically create jpeg files? I
think RImageMagick could do this but it seems like it's loaded with
dependences.

Ideally I'd like to send an Array of lines with color values to be
written out to a jpeg. It wouldn't have to support options for encoding.

I'm thinking might go to bmp because I think it may be straightforward
enough to roll my own simple class for this. I'd prefer jpeg and I'm not
sure if I want to spend the time writing something for encoding a jpeg.

Thanks,
Mike
 
A

A.S. Bradbury

Is there an easy lightweight way to dynamically create jpeg files? I
think RImageMagick could do this but it seems like it's loaded with
dependences.

Ideally I'd like to send an Array of lines with color values to be
written out to a jpeg. It wouldn't have to support options for encoding.

I'm thinking might go to bmp because I think it may be straightforward
enough to roll my own simple class for this. I'd prefer jpeg and I'm not
sure if I want to spend the time writing something for encoding a jpeg.

Thanks,
Mike

From the sound of what you're doing, it sounds like PNG may be more
suitable than JPEG (but maybe I'm making an invalid assumption here).
Try gem install png. It's a pure-ruby png library from seattle.rb.
Take a look at the rdoc using gem_server and you're good to go. This
definitely handles your dependency worries. If performance should
prove to be a problem then you might try imlib2-ruby.

Alex
 
M

Mike Nelson

A.S. Bradbury said:
From the sound of what you're doing, it sounds like PNG may be more
suitable than JPEG

I gave seattle.rb's png a quick go and it looks perfect for what I need.

Thanks!
 

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
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top