[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Is there any library that can easily manipulate Bitmap (bmp) file?

sin kanti

4/10/2005 10:30:00 PM

Hi all,

In my project, i wanna resize original bmp file to 60x40 and make them
1-bit color.
Then, store each bit it into an array for data processing.

Is there any library that can do what i want in Ruby?

Thank you,

Sinchai


2 Answers

Tim Hunter

4/10/2005 10:34:00 PM

0

sin kanti wrote:
> Hi all,
>
> In my project, i wanna resize original bmp file to 60x40 and make them
> 1-bit color.
> Then, store each bit it into an array for data processing.
>
> Is there any library that can do what i want in Ruby?
>
> Thank you,
>
> Sinchai
>
>
RMagick
http://rmagick.rub...
http://www.simplesystems.org/RMagick/doc/...

Wesley J. Landaker

4/10/2005 10:58:00 PM

0

On Sunday 10 April 2005 16:30, sin kanti wrote:
> Hi all,
>
> In my project, i wanna resize original bmp file to 60x40 and make them
> 1-bit color.
> Then, store each bit it into an array for data processing.
>
> Is there any library that can do what i want in Ruby?

Often, the easiest way to manipulate images is to convert them to PNM
format, and then manipulate that (and then convert back). You can do this
with something like the netpbm package <http://netpbm.sourceforg... or
ImageMagick, or something similar.

It's not a ruby-specific solution, but it's cross-platform, and I use often
use that to manipulate images with ruby. =)

(And I'm sure someone else could point out a native ruby PNM library, or a
binding to netpbm or ImageMagick.)

--
Wesley J. Landaker <wjl@icecavern.net>
OpenPGP FP: 4135 2A3B 4726 ACC5 9094 0097 F0A9 8A4C 4CD6 E3D2