Lightweight way to create jpeg files?


#1

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


#2

On 2/24/07, Mike N. removed_email_address@domain.invalid wrote:

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


#3

A.S. Bradbury wrote:

On 2/24/07, Mike N. removed_email_address@domain.invalid wrote:

Thanks,
Mike

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!