Forum: Ruby Lightweight way to create jpeg files?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Mike Nelson (Guest)
on 2007-02-24 18:38
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.S. Bradbury (Guest)
on 2007-02-25 00:29
(Received via mailing list)
On 2/24/07, Mike Nelson <miken700@yahoo.com> 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
7911867436aa8810edac0c22cf620fc5?d=identicon&s=25 Mike N. (miken700)
on 2007-02-25 15:14
A.S. Bradbury wrote:
> On 2/24/07, Mike Nelson <miken700@yahoo.com> 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!
This topic is locked and can not be replied to.