# How to switch from GD to ImageMagic as image engine?

**URL:** https://forum.getkirby.com/t/how-to-switch-from-gd-to-imagemagic-as-image-engine/679
**Category:** Questions
**Tags:** v2
**Created:** [April 2, 2015, 9:56am UTC](https://forum.getkirby.com/t/how-to-switch-from-gd-to-imagemagic-as-image-engine/679 "2015-04-02T09:56:49Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![felixbridell](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/felixbridell/32/6626_2.png) [@felixbridell](https://forum.getkirby.com/u/felixbridell)
#### Post date: [April 2, 2015, 9:56am UTC](https://forum.getkirby.com/t/how-to-switch-from-gd-to-imagemagic-as-image-engine/679/1 "2015-04-02T09:56:49Z")

</div>

Hi. I often use Kirby for photo intensive pages and on the project I’m working on now I also use srcset for responsive images. One single image can end up having 4-8 different sizes (thumbnail + large image for gallery). I use the thumb() function to resize the uploaded images to all the different sizes which put a lot off work on the server. And if the gallery have a lot of images (10-20) the script will exit before all the images have been created and the page break.

For what I understand, ImageMagic can make a better job for this then the default GD library. Also ImageMagis should be better on handle big images. If this is true, can some one please help me switch from GD to ImageMagic? Or should I change the way I handling the images for the galleries on the page?

---

<div class="post-metadata">

### Author: ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)
#### Post date: [April 2, 2015, 10:03am UTC](https://forum.getkirby.com/t/how-to-switch-from-gd-to-imagemagic-as-image-engine/679/2 "2015-04-02T10:03:40Z")

</div>

You can switch that in config.php

```auto
c::set('thumbs.driver', 'im');

```

[http://getkirby.com/docs/advanced/options](http://getkirby.com/docs/advanced/options)

---

<div class="post-metadata">

### Author: ![felixbridell](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/felixbridell/32/6626_2.png) [@felixbridell](https://forum.getkirby.com/u/felixbridell)
#### Post date: [April 2, 2015, 1:00pm UTC](https://forum.getkirby.com/t/how-to-switch-from-gd-to-imagemagic-as-image-engine/679/3 "2015-04-02T13:00:14Z")

</div>

Nice, Thank you.  
Just can’t get ImageMagic to work with my MAMP installation. I have installed ImageMagic and can run it from the Terminal, but it doesn’t work on the web page.

---

<div class="post-metadata">

### Author: ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)
#### Post date: [April 3, 2015, 2:07pm UTC](https://forum.getkirby.com/t/how-to-switch-from-gd-to-imagemagic-as-image-engine/679/4 "2015-04-03T14:07:28Z")

</div>

Have you been able to solve this? I just ran into the same problem when I wanted to test the new unlimited thumb creation on panel; ImageMagick installed and accessible via terminal, `extension=imagick.so` enabled in Mamp Pro config, but not thumbs and the ImageMagick class not available via php

---

<div class="post-metadata">

### Author: ![felixbridell](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/felixbridell/32/6626_2.png) [@felixbridell](https://forum.getkirby.com/u/felixbridell)
#### Post date: [April 4, 2015, 10:05am UTC](https://forum.getkirby.com/t/how-to-switch-from-gd-to-imagemagic-as-image-engine/679/5 "2015-04-04T10:05:02Z")

</div>

No I haven’t. Still got problem to get ImageMagic work. Did the the [extension=imagick.so](http://extension=imagick.so) too but it didn’t help. I use the free version of MAMP (3.0.7.2) and OS X Yosemite. Would like to find a solution. On the Mamp Pro homepage they say that ImageMagic comes pre installed with version 3 ([http://www.mamp.info/en/mamp-pro/](http://www.mamp.info/en/mamp-pro/)).

---

<div class="post-metadata">

### Author: ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)
#### Post date: [April 4, 2015, 10:13am UTC](https://forum.getkirby.com/t/how-to-switch-from-gd-to-imagemagic-as-image-engine/679/6 "2015-04-04T10:13:05Z")

</div>

Yeah, I tested this with Mamp Pro for that exact reason, that the php module comes preinstalled and you only have to switch it on in php.ini, but I would think that the module would show up in phpinfo which it doesn’t though.

---

<div class="post-metadata">

### Author: ![felixbridell](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/felixbridell/32/6626_2.png) [@felixbridell](https://forum.getkirby.com/u/felixbridell)
#### Post date: [April 5, 2015, 7:18am UTC](https://forum.getkirby.com/t/how-to-switch-from-gd-to-imagemagic-as-image-engine/679/7 "2015-04-05T07:18:38Z")

</div>

Feels like I tried all the trix from all the articles on the web, but still not working.  
If I do \<?php phpinfo(); ?\> I get an imagick sections so it looks like ImageMagic module is loaded.  
Do I need to make som more changes in the Kirby code @bastianallgeier?

---

<div class="post-metadata">

### Author: ![bastianallgeier](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/bastianallgeier/32/7569_2.png) [@bastianallgeier](https://forum.getkirby.com/u/bastianallgeier)
#### Post date: [April 6, 2015, 1:39pm UTC](https://forum.getkirby.com/t/how-to-switch-from-gd-to-imagemagic-as-image-engine/679/8 "2015-04-06T13:39:30Z")

</div>

Maybe the path to the convert bin is not set properly in PHP. You can try to fix this by directly linking to convert with:

```php
// config.php

thumb::$defaults['bin'] = '/usr/local/bin/convert';

```

Make sure to set the path right here. Not sure where it is located in your case.

---

<div class="post-metadata">

### Author: ![felixbridell](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/felixbridell/32/6626_2.png) [@felixbridell](https://forum.getkirby.com/u/felixbridell)
#### Post date: [April 6, 2015, 7:06pm UTC](https://forum.getkirby.com/t/how-to-switch-from-gd-to-imagemagic-as-image-engine/679/9 "2015-04-06T19:06:27Z")

</div>

There you go! Now it works, and ImageMagic does a better job, the page does not break now.  
The path for me was:

```auto
thumb::$defaults['bin'] = '/opt/local/bin/convert';

```

Thank you.

---

<div class="post-metadata">

### Author: ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)
#### Post date: [April 6, 2015, 7:52pm UTC](https://forum.getkirby.com/t/how-to-switch-from-gd-to-imagemagic-as-image-engine/679/10 "2015-04-06T19:52:14Z")

</div>

> [@bastianallgeier](#):
>
> thumb::$defaults[‘bin’] = ‘/usr/local/convert’;

Yeah, thanks, @bastianallgeier, that’s exactly what was missing …

---

<div class="post-metadata">

### Author: ![Stolzenhain](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/stolzenhain/32/4773_2.png) [@Stolzenhain](https://forum.getkirby.com/u/Stolzenhain)
#### Post date: [April 28, 2015, 3:45pm UTC](https://forum.getkirby.com/t/how-to-switch-from-gd-to-imagemagic-as-image-engine/679/11 "2015-04-28T15:45:35Z")

</div>

Hello! Thanks for the helpful MAMP tips – I followed your advice, but none of the path options worked, while `/Applications/MAMP/Library/bin/convert` did. I have the feeling this is somehow not the right way, but will leave this here for reference. (Using MAMP Pro 3)

---

<div class="post-metadata">

### Author: ![lukasbestle](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/lukasbestle/32/11437_2.png) [@lukasbestle](https://forum.getkirby.com/u/lukasbestle)
#### Post date: [April 28, 2015, 4:41pm UTC](https://forum.getkirby.com/t/how-to-switch-from-gd-to-imagemagic-as-image-engine/679/12 "2015-04-28T16:41:14Z")

</div>

It is. Since ImageMagic is included with MAMP but not in the base system of OS X, the path you wrote is correct. It simply depends on the setup. 🙂

---

<div class="post-metadata">

### Author: ![Stolzenhain](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/stolzenhain/32/4773_2.png) [@Stolzenhain](https://forum.getkirby.com/u/Stolzenhain)
#### Post date: [April 30, 2015, 8:21am UTC](https://forum.getkirby.com/t/how-to-switch-from-gd-to-imagemagic-as-image-engine/679/13 "2015-04-30T08:21:13Z")

</div>

Ah okay, I recall struggling with installing the lib several times and getting it to work via Terminal but not in MAMP. I was pretty happy when they finally included it in MAMP as the MAMP/Brew hacks differed on every OSX version.

---

<div class="post-metadata">

### Author: ![josh.peterson](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/josh.peterson/32/2649_2.png) [@josh.peterson](https://forum.getkirby.com/u/josh.peterson)
#### Post date: [August 4, 2016, 6:32pm UTC](https://forum.getkirby.com/t/how-to-switch-from-gd-to-imagemagic-as-image-engine/679/14 "2016-08-04T18:32:51Z")

</div>

For those joining us in 2016 or later -

you now need to do use this syntax instead:

c::set(‘thumbs.bin’, ‘/usr/local/bin/convert’);

Can we put this in the docs page on [Thumbs Configuration](https://getkirby.com/docs/developer-guide/configuration/thumbnails)?

As seen here:

> <https://github.com/getkirby/kirby/issues/453>

Also, if you make a testfile.php with the contents:  
`<?php phpinfo() ?>`

It’ll tell you which version of php you’re running in MAMP. Then you can use that to find the correct directory your mamp [php.in](http://php.in) is in. Replace the contents of that testfile.php with `print(class_exists('imagick'));` to test that the image magick class is available.

---

<div class="post-metadata">

### Author: ![lukasbestle](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/lukasbestle/32/11437_2.png) [@lukasbestle](https://forum.getkirby.com/u/lukasbestle)
#### Post date: [August 4, 2016, 7:01pm UTC](https://forum.getkirby.com/t/how-to-switch-from-gd-to-imagemagic-as-image-engine/679/15 "2016-08-04T19:01:23Z")

</div>

Thanks for the suggestion. I have added a note, should be live on the site soon.

---

<div class="post-metadata">

### Author: ![anon77445132](https://avatars.discourse-cdn.com/v4/letter/a/4da419/32.png) [@anon77445132](https://forum.getkirby.com/u/anon77445132)
#### Post date: [August 5, 2016, 12:36pm UTC](https://forum.getkirby.com/t/how-to-switch-from-gd-to-imagemagic-as-image-engine/679/16 "2016-08-05T12:36:33Z")

</div>

Hello @lukasbestle, please add there a hint, that “XAMPP on Windows” until now has only the GD driver!

Some issues here had been written, because their developers did not know this.

---

<div class="post-metadata">

### Author: ![lukasbestle](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/lukasbestle/32/11437_2.png) [@lukasbestle](https://forum.getkirby.com/u/lukasbestle)
#### Post date: [August 5, 2016, 12:42pm UTC](https://forum.getkirby.com/t/how-to-switch-from-gd-to-imagemagic-as-image-engine/679/17 "2016-08-05T12:42:02Z")

</div>

It’s not related to XAMPP, users could still install the ImageMagic CLI themselves (that it needs to be available is stated in the docs already). Thanks for the suggestion though.

---

<div class="post-metadata">

### Author: ![anon77445132](https://avatars.discourse-cdn.com/v4/letter/a/4da419/32.png) [@anon77445132](https://forum.getkirby.com/u/anon77445132)
#### Post date: [August 5, 2016, 12:49pm UTC](https://forum.getkirby.com/t/how-to-switch-from-gd-to-imagemagic-as-image-engine/679/18 "2016-08-05T12:49:13Z")

</div>

But using XAMPP I think to get the correct driver is not easy, so nearly nobody will be able to do this, if she/he is a newbie…

Normaly XAMPP is a black box without the source code!

---

<div class="post-metadata">

### Author: ![lukasbestle](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/lukasbestle/32/11437_2.png) [@lukasbestle](https://forum.getkirby.com/u/lukasbestle)
#### Post date: [August 5, 2016, 4:15pm UTC](https://forum.getkirby.com/t/how-to-switch-from-gd-to-imagemagic-as-image-engine/679/19 "2016-08-05T16:15:38Z")

</div>

But newbies don’t change the default thumb driver, right? 🙂

---

<div class="post-metadata">

### Author: ![bnomei](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/bnomei/32/775_2.png) [@bnomei](https://forum.getkirby.com/u/bnomei)
#### Post date: [August 19, 2016, 8:44am UTC](https://forum.getkirby.com/t/how-to-switch-from-gd-to-imagemagic-as-image-engine/679/20 "2016-08-19T08:44:44Z")

</div>

thumbs.bin can be set in config file too, right?

```
c::set('thumbs.bin', 'path/to/convert');

```

> <https://github.com/getkirby/kirby/blob/master/kirby/component/thumb.php#L70>

from my expierence one has to logout of [authentification](https://getkirby.com/docs/cookbook/authentication) to refresh the code in a thumbs driver. why is that btw?

[Next page](https://forum.getkirby.com/t/how-to-switch-from-gd-to-imagemagic-as-image-engine/679.md?page=2)
