main content, site navigation, search

ImageMagick with MAMP

Many web designers and front-end developers are using MAMP for its ease of use. However, MAMP doesn’t come with very popular and wide spread image manipulation library ImageMagick. Just recently my fellow internet super talent Mario Lončarić clarifyied steps for installing ImageMagick library to your Mac with MAMP.

Obviously, this article is not for Terminal savvy programmers, but rather for the rest of us who are using drag and drop web server packages such as MAMP.

I guess you already have MAMP installed on your local computer, most likely in /Applications/MAMP. If not, install it before you move on to the next step.

First, download ImageMagick for Mac OS X and unarchive it to /Applications/MAMP/bin/ImageMagick.

Next, open up Terminal.app (don’t be afraid, it won’t bite you), and enter line by line:

$yourmacname> export MAGICK_HOME="/Applications/MAMP/bin/ImageMagick/ImageMagick-6.6.1"
$yourmacname> export PATH="$MAGICK_HOME/bin:$PATH"
$yourmacname> export DYLD_LIBRARY_PATH="$MAGICK_HOME/lib"

Test if everything works up to this point:

$yourmacname> cd /Applications/MAMP/bin/ImageMagick/ImageMagick-6.6.1
$yourmacname> convert logo: logo.gif
$yourmacname> identify logo.gif
$yourmacname> display logo.gif

Last: browse to /Applications/MAMP/Library/bin and open envvars file with your text editor. Change the two uncommented lines, i.e. DYLD_LIBRARY_PATH="... and export... to following:

DYLD_LIBRARY_PATH="/Applications/MAMP/bin/ImageMagick/ImageMagick-6.6.1/lib:/Applications/MAMP/Library/lib:$DYLD_LIBRARY_PATH"
export DYLD_LIBRARY_PATH

If you are using ImageMagick in your server-side application, be sure to set the correct path, for instance in PHP:

define('MAGICK_PATH', '/Applications/MAMP/bin/ImageMagick/ImageMagick-6.6.1/bin/convert');

Restart Apache in MAMP and you’re done.

4 shouts to “ImageMagick with MAMP”

  1. James John Malcolm
    001—2010.05.12.23:10

    So where does that php path defining bit go exactly?

    The rest is exceptionally clear! Are the MAMP peeps planning to include this in the future?

  2. Marko Dugonjić
    002—2010.06.03.14:48

    The default Magick path on most hosting servers is simply ‘convert’, but if you need it to work on your local computer the above example is the correct path.

    If you don’t know where to put it, then you’re probably not even using ImageMagick. Most 3rd party scripts use GD, which is more common. Find out more on image processing with PHP: http://www.php.net/manual/en/refs.utilspec.image.php

  3. adam187
    003—2010.06.07.08:27

    There is a wrong path in envvars:
    /Applications/MAMP/bin/imagick/ImageMagick-6.6.1 =>
    /Applications/MAMP/bin/ImageMagick/ImageMagick-6.6.1

  4. Marko Dugonjić
    004—2010.06.07.10:04

    @adam thanks, it’s fixed now :)

main content, site navigation, search