Editing GraphicsMagick
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
Octave will use [http://www.graphicsmagick.org/ GraphicsMagick] for reading and writing your images (not | Octave will use [http://www.graphicsmagick.org/ 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. | ||
== Building == | |||
See below for the reasoning behind each flag and tracking dependencies. Once done, the following commands should work to build GraphicsMagick. | |||
<pre> | <pre> | ||
./configure --with-quantum-depth= | ./configure --with-quantum-depth=32 --enable-shared --disable-static --with-magick-plus-plus=yes | ||
make | make | ||
make check | make check | ||
sudo make install | sudo make install | ||
</pre> | </pre> | ||
== Quantum depth == | == Quantum depth == | ||
The most common problem is the following warning when using {{Codeline|imread()}} | The most common problem is the following warning when using {{Codeline|imread()}}: | ||
<pre>warning: your version of GraphicsMagick limits images to 8 bits per pixel</pre> | <pre>warning: your version of GraphicsMagick limits images to 8 bits per pixel</pre> | ||
The reason for this is that GraphicsMagick was compiled with {{Codeline|--with-quantum-depth 8}}. Possible values are 8, 16 or 32, each implememnting that limitation. See the {{Path|INSTALL}} [http://graphicsmagick.hg.sourceforge.net/hgweb/graphicsmagick/graphicsmagick/file/tip/INSTALL-unix.txt#l429 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: [http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=557879 Debian], [https://bugs.launchpad.net/ubuntu/+source/graphicsmagick/+bug/696215 Ubuntu]. | |||
There | |||
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++ == | ||
Line 37: | Line 27: | ||
== Dependencies == | == 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. Note however that this is the list of all dependencies and suggestions. For Octave purposes only, you definetely will not need all of these. | 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. Note however that this is the list of all dependencies and suggestions. For Octave purposes only, you definetely will not need all of these. | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
! Dependency !! Debian Wheezy !! Ubuntu Precise | ! Dependency !! Debian Wheezy !! Ubuntu Precise | ||
|- | |- | ||
| BZLIB || libbz2-dev || libbz2-dev | | BZLIB || libbz2-dev || libbz2-dev | ||
|- | |- | ||
| | | dcraw || dcraw || dcraw | ||
|- | |- | ||
| | | dot || graphviz || graphviz | ||
|- | |- | ||
| | | fig2dev || transfig || transfig | ||
|- | |- | ||
| | | FlashPIX || || | ||
|- | |- | ||
| | | FreeType 2.0 || libfreetype6-dev || libfreetype6-dev | ||
|- | |- | ||
| | | Ghostscript || ghostscript || ghostscript | ||
|- | |- | ||
| | | Ghostscript-fonts || gsfonts || gsfonts | ||
|- | |- | ||
| | | gnuplot || gnuplot || gnuplot | ||
|- | |- | ||
| | | hp2xx || hp2xx || hp2xx | ||
|- | |- | ||
| | | html2ps || html2ps || html2ps | ||
|- | |- | ||
| | | JBIG || libjbig-dev || | ||
|- | |- | ||
| | | JPEG v1 || libjpeg8-dev || libjpeg-dev | ||
|- | |- | ||
| | | JPEG-2000 || libjasper-dev || libjasper-dev | ||
|- | |- | ||
| | | LCMS v2 || liblcms2-dev || liblcms2-dev | ||
|- | |- | ||
| | | ltdl || libltdl-dev || libltdl-dev | ||
|- | |- | ||
| | | LZMA || liblzma-dev || liblzma-dev | ||
|- | |- | ||
| | | PNG || libpng12-dev || libpng12-dev | ||
|- | |- | ||
| | | ra_ppm || radiance || radiance | ||
|- | |- | ||
| scanimage || sane-utils || sane-utils | |||
| | |||
|- | |- | ||
| | | TIFF || libtiff5-dev || libtiff5-dev | ||
|- | |- | ||
| | | TRIO || || | ||
|- | |- | ||
| | | WMF || libwmf-dev || libwmf-dev | ||
|- | |- | ||
| | | X11 || libx11-dev libxext-dev libsm-dev || | ||
|- | |- | ||
| | | XML || libxml2-dev || libxml2-dev | ||
|- | |- | ||
| | | ZLIB || zlib1g-dev || zlib1g-dev | ||
|- | |- | ||
|} | |} | ||
You will also need to install g++ and gcc (or alternatives). | |||
{{Note|DPS has been [http://dps.sourceforge.net/ deprecated] and should not be used hence why is not on the list.}} | |||
{{Note|Ghostscript library support is not recommended by GraphicsMagick hence why is not on the list.}} | |||
{{Note|there are both LCMS v2 and v1 but GraphicsMagick only needs one of them.}} |