Re: Bitmap -> GIF/PNG/JPG
- From: Tim Hunter <rmagick@xxxxxxxxx>
- Date: Mon, 21 May 2007 21:00:26 +0900
Michael Mahemoff wrote:
Hi,Check out Magick::Image#import_pixels:
Can anyone please recommend a package for generating images from a
bitmap vector. e.g. If I have an list of integers, each representing a
colour on the bitmap, and I want to build a GIF from it (along with some
other meta-info like dimensions).
The main options seem to be RMagick and RCairo, but neither seems to
take a bitmap input. I'd have to create a blank canvas and draw each
pixel. Do-able but inefficient.
http://www.simplesystems.org/RMagick/doc/image2.html#import_pixels. If
the input pixels are in a string buffer this is an extremely fast
method. If the pixel data are in an array it's still faster than drawing
each pixel separately.
If your pixel data are in a file you may be able to simply describe it
as being in "RGB" or "RGBA" format, in which case RMagick can convert it
for you. See http://www.imagemagick.org/script/formats.php.
--
Posted via http://www.ruby-forum.com/.
.
- References:
- Bitmap -> GIF/PNG/JPG
- From: Michael Mahemoff
- Bitmap -> GIF/PNG/JPG
- Prev by Date: Re: How to adopt "Python Style" indentation for Ruby
- Next by Date: Re: Simple Q: object creation to be determined by incoming data
- Previous by thread: Bitmap -> GIF/PNG/JPG
- Next by thread: Re: Simple Q: object creation to be determined by incoming data
- Index(es):
Relevant Pages
|