Image/Paint libraries

Boudewijn Rempt boud at valdyas.org
Mon May 24 15:04:54 CEST 2004


I've spent some time typing up a summary of the various 
image/imaging/paint/graphics libs that I have considered, or that have been 
considered, for Krita's core. As it is, I still think that the best thing is 
to forge ahead and make our own core into a separate lib with a well-defined 
and preferably small interface to the app itself, instead of doing another 
corectomy; but it's good to know what's out there. I've put the summaries in 
a file IMAGE_LIBS that I've added to Krita's CVS, but here's the text, too:

* Krita  (http://koffice.kde.org/krita)

Krita contains its own 2D image library, consisting of the tile
manager, the layer classes and KisPainter. We really should separate
this 2d lib from the interface code, and put it in a real lib with 
a well-defined interface.

Advantages:

	- Already works
	- Optimized for interactive work
	- Allows different colour models
	- Uses GraphicsMagick or ImageMagick for loading and saving.

Disadvantages:
	
	- Does not work well with different channel depths
	- Not integrated with CMS
	- TileManager complicated and slow for pixel reading and
	  writing.
	  
* Gimp (http://www.gimp.org)

The Gimp contains a complex core that allows interactive painting of
images with a channel depth of 8 bits.

Advantages:

	- Well tested, very complete
	- Optimized for interactive usage

Disadvantages:

	- Written in C.
	- Not readily available as a library.
	- Depends on glib and gtk
	- 8-bit only
	- No colour models
	- Has problems handling really large images

* Vigra (http://kogs-www.informatik.uni-hamburg.de/~koethe/vigra/)

Vigra is a C++ imaging library written by Ullrich Koetthe to
demonstrate his Phd thesis on flexible image algorithms.

Advantages:

	- Supports very large images
	- Supports colour models
	- Supports different bit depths through templating
	- C++
	- Relatively small
	- Relatively well-documented

Disadvantages:

	- License incompatible with GPL?
	- Not optimized for interactive use
	- Unsure about future development since this was a research
	  project.

* Vips (http://www.vips.ecs.soton.ac.uk/)

Vips is a C library with a C++ layer. It has been designed for
handling very large images, mainly in the context of research into
paintings in museums like the National Gallery. It comes with a gtk2
gui.

Advantages:

	- Handles very large images
	- Handles colour models
	- Handles different bit depths
	- C++ interface

Disadvantages:

	- Not optimized for paintbox type apps (even though it is
	  possible).
	- Very large.

* VXL (http://vxl.sourceforge.net/)

VXL is a collection of small libraries that are used for compution
vision and imaging purposes in an academic setting.

Advantages:

	- Handles very large images
	- C++

Disadvantages:

	- Not recently updated
	- Comes with its own core libraries that replace standard C++
	- Optimized for simple rgb images.
	- No license at all
	- Badly documented

* CImg (http://cimg.sourceforge.net/)

CImg is a very cool, very small library that offers some extremely
innovative image effects, like inpainting of damaged or noise images.

Advantages:
	
	- Small
	- GPL
	- Cool stuff

Disadvantages:

	- Everything, including GUI stuff, in one header file.
	- badly documented.


* Gegl (http://www.gegl.org/)

Gegl was intended to become the Gimp 2.0 core, but development had
stalled so much that the move to Gegl didn't happen before Gimp 2.0.
However, the Thawte millionaire whose name has escaped me, has
promised to support gegl development financially, freeing the
developer to work full-time on it. It is, more or less, an attempt to
write a templated library in C++ with the help of a custom language to
describe image operations.

Advantages:
	
	- It's got money behind it
	- Small
	- Optimized for interactive use

Disadvantages:

	- Not finished yet
	- C
	- Complex hack around the fact that C is a low-level language

* libart_lgpl (http://www.levien.com/libart/)

Libart isn't really an image library, but rather a canvas that can be
used to paint images on. It is optimized for vector graphics, and is
used by Karbon to render shapes before display.

Advantages:

	- Raph Levien is really good at this stuff, so libart is
	  quality

Disadvantages:

	- C
	- It isn't an image library, really


* java2D (http://java.sun.com/j2se/1.4.2/docs/guide/2d/index.html)


Java2D is more or less complete library to write a paint app around.
It offers image types, colour spaces, kernel convolutions and text.
It's in Java, of course, and the free re-implementation is not done
yet, and besides, is based around Cairo.

Advantages:
	
	- Neat OO design
	- Complete

Disadvantages:

	- Java
	- Not free
	- Has some legacy cruft.

* ImageMagick/GraphicsMagick (http://imagemagick.org/, 
http://www.graphicsmagick.org/)

GraphicsMagick is ImageMagick with a different license, and a
focus on API stability. GM and IM now also differ slightly in terms of
features offered. Krita used to be based around IM (which can still be
seen in many places in the code). The IM core was dropped in favour of
the present core because it turned out that IM was not re-entrant,
making it hard to use in an interactive application.

Advantages:

	- Mature
	- C++ interface
	- Full-featured
	- RGB and CMYK (but not more)
	- License compatible with Krita
	- Under active development

Disadvantages:

	- Bit-depth a compile-time option
	- Not re-entrant: not optimized for interactive use.

* Paintlib2 (http://www.paintlib.de/paintlib/)

A portable (windows/Linux) library for image loading, manipulation and
saving. The same kind of thing as IM/GM, but not quite as mature.

Advantages:

Disadvantages:
 	
	- No support for larger bit depths per channel
	- Windows (bmp) centric
	- Development seems to have stopped in 2000



-- 
Boudewijn Rempt | http://www.valdyas.org/fading/index.cgi


More information about the kimageshop mailing list