GraphicsMagick

Revision as of 14:35, 10 August 2012 by Carandraug (talk | contribs) (prettier table)

Octave will use GraphicsMagick for reading and writing your images (not plots, only if you are actually doing image processing). This means that the GraphicsMagick configuration you have on you system will limit what your Octave installation can do. Most systems will have it onn their repositories. Unfortunately, their configuration is not always the best for image analysis as it limits reading of images to 8-bit.

Quantum depth

The most common problem is the following warning when using imread():

warning: your version of GraphicsMagick limits images to 8 bits per pixel

The reason for this is that GraphicsMagick was compiled with --with-quantum-depth 8. Possible values are 8, 16 or 32, each implememnting that limitation. See the INSTALL file on GraphicsMagick sourcefor an explanantion of this. There has bugs reported requesting package maintainers to compile it with higher values. You should not create a new bug, instead leave a comment on the already open bugs: Debian, Ubuntu.

As versions with higher values are not available on the repositories, the solution is to compile it. Octave needs then to be recompiled to use the freshly compiled Magick++ library.

Magick++

Magick++ is the C++ application programming interface to GraphicsMagick. This is what Octave uses so you will need this when compiling GraphicsMagick. This will be enabled by default but if you don't have a C++ compiler installed (such as g++) GraphicsMagick will build just fine without a warning, just a small note during the run of configure.

Shared libraries

The default is to disable shared libraries but that won't work with Octave. You will need to pass the --enable-shared option. If you do not, Octave will give the following warning when running configure:

GraphicsMagick++ library fails tests.  The imread function for reading image files will not be fully functional.

Dependencies

Compiling from source means tracking the dependencies yourself which may be a kind of painful. There's no wiki for GraphicsMagick so the following table hopes to makes things easier:

Dependency Debian Ubuntu
liblzma liblzma-dev liblzma-dev
libtiff libtiff5-dev libtiff5-dev
libwmf libwmf-dev libwmf-dev
libxml2 libxml2-dev libxml2-dev
zlib zlib1g-dev zlib1g-dev