Index: imageapi_imagemagick.module
===================================================================
--- imageapi_imagemagick.module	(revision 400)
+++ imageapi_imagemagick.module	(working copy)
@@ -48,6 +48,13 @@
     '#element_validate' => array('imageapi_imagemagick_validate_path'),
   );
 
+  $form['imageapi_imagemagick_binary']['imageapi_imagemagick_prepend_args'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Prepend arguments'),
+    '#default_value' => variable_get('imageapi_imagemagick_prepend_args', ''),
+    '#description' => t('Arguments to add before all other arguments.  For example, specify <kbd>convert</kbd> here and specify the path to the GraphicsMagick <kbd>gm</kbd> binary above.'),
+  );
+
   $form['imageapi_imagemagick_binary']['imageapi_imagemagick_debugging'] = array(
     '#type' => 'checkbox',
     '#title' => t('Display debugging information'),
@@ -178,6 +185,12 @@
     return FALSE;
   }
 
+  // Prepend any custom arguments.
+  $prepend_args = variable_get('imageapi_imagemagick_prepend_args', '');
+  if (!empty($prepend_args)) {
+    $convert_path .= ' '. $prepend_args;
+  }
+
   if (strstr($_SERVER['SERVER_SOFTWARE'], 'Win32') || strstr($_SERVER['SERVER_SOFTWARE'], 'IIS')) {
     // Use Window's start command to avoid the "black window" from showing up:
     // http://us3.php.net/manual/en/function.exec.php#56599
