image loading with GD

Greg Hamerly <[email protected]> Wed, 24 Dec 2003 02:38:30 -0600
Newsgroups gmane.comp.gnu.octave.sources
Message-ID <[email protected]>
Hi all,

This weekend I wanted to load some images in to Octave to do some data
analysis, but I found that it was difficult to do. I have searched a bit
through the Octave mailing list archives but didn't find exactly what I
was looking for.

I wrote a small .oct file for using GD to load images of PNG, JPG, and XBM
into Octave (since these are the supported types of GD). I tried to use
Imlib as well, but I couldn't get it to work, so I stuck with GD.

If you find this interesting, please try it out and let me know. There are
many improvements that can be made, but for now it's simple and fast.

The code is available at 
http://www.cs.kuleuven.ac.be/~greg/software/gd_imgload.cc

It can be compiled on a Linux system with GD installed with:
"mkoctfile -lgd gd_imgload.cc"

Thanks,
- greg