










|
So ... what IS Imlib? It is a low-level Image loading, and rendering library
that is designed to replace libXpm as the standard image loading library
for X11. Why am I doing this?
-
LibXpm can only load Xpm format images.
-
Xpm format is a highly space and cpu (for loading) inefficient way of
storing Image data. It also only provides colormapped images, which, for
large smoothly shaded backgrounds can be limitng for people with high-color
displays.
-
LibXpm has no ability to remap images to a pre-defined set of colours (and
so in 8 bit displays allowing images to eat up whole colormaps), and if
colors could not be obtained it only uses the nearest-match algorithm,
rather than having options for dithering to improve image quality in low-color
situations.
-
LibXpm can become excessively slow in loading Images once 100 or so have
already been loaded (the slowdown is exponential).
Now why do you ask, should you use Imlib for your programs?
-
Imlib can (via the use of external "Helper-Apps" like Imagemagick, or
NetPBM) load many, many , many formats (to start, PPM, PGM, JPEG, GIF,
BMP, PCX, XPM, TARGA, IFF, TIFF, etc.).
-
Imlib is able to (via user or system-wide config files) resrict the palette
usage of Imlib based apps (like enlightenment) to a certain set of colors (a
palette) which can be desgined to offer only the colors the user uses or
wants on his desktop, and so conserve colormap usage. At the same time this
can also be allowed to lapse if oneday X is run in a higher bit depth like
15, 16 or 24 bits per pixel.
-
Imlib has options for dithering remapped images to improve image quality.
-
Imlib can also SCALE images on the fly (from 24-bit images kept im memory)
FAST, so allow programmers to create pseudo-resolution independant images for
their Apps, and only resize them at runtime according to context.
-
Imlib can be FAST. It uses optimised rendering routines, and the Mit-Shm
extension where possible to gain maximum speed.
Some problems currently with Imlib are that it has some endianess problems
on strange setups and systems. It also doesn't detect bit-depth well
currently on "bizzarre" X-Servers (mainly high-end workstation ones like
SGI's, Sun's and HP's). This is primarily due to the fact I have no access
to such machines, and so have buckleys of debugging and investigating the
Xserver features. I do hope that in time this will be fixed, and so Imlib
will become truly universal.
If you're a programmer, and interested in Imlib, try the
Download page, and get the Imlib archive, and read imlib.h (it's PACKED
with comments on how to use the library, and in TST is a sample program to
test it. You should also look at Enlightenment. It relies on Imlib for a lot
of its "magic").
|