Appendix A - Miscellaneous

A.1 Example - Hello World

#include <libmtpixel.h>

int main()
{

}

This program is compiled and run by using:

gcc hello.c -lmtpixel -o hello
./hello

A.2 Supported File Types

libmtpixel can handle the following file formats:

Format Load Save
BMP All. Indexed palette. 24 bit RGB including alpha channel.
GIF All single images. Indexed palette including transparency index. Animations via Gifsicle.
JPEG All. 24 bit RGB.
JPEG2000 All. 24 bit RGB.
LSS16 (*.lss) All. Indexed palette (16 colours), 18 bits per colour (6 per RGB channel).
PNG All. Indexed palette. 24 bit RGB. Including transparency index, alpha/selection/mask channels.
TGA All. Indexed palette. 24 bit RGB including alpha channel.
TIFF All. Indexed palette. 24 bit RGB. Including alpha channel.
XBM All. 2 colour indexed palette including hotspot.
XPM All. Indexed palette. 24 bit RGB. Including transparency index and hotspot.

File types PNG, JPEG, JPEG2000, TIFF, XPM, and GIF are handled by external libraries: libpng, libjpeg, libopenjpeg, libtiff, libXpm, and libungif/giflib. As a result of this, the efficiency of these file operations will depend on the version of these libraries installed on your system. For example, libtiff is unable to read certain old JPEG compressed TIFF files. For more information on these libraries, consult their respective websites:

libpng http://www.libpng.org/pub/png/libpng.html
libjpeg http://www.ijg.org/
libopenjpeg http://www.openjpeg.org/
libtiff http://www.libtiff.org/
libXpm http://www.inria.fr/koala/lehors/xpm.html or http://www.x.org/ or http://www.xfree86.org/
libungif / giflib http://libungif.sourceforge.net/doc/