Index: imagecache.module
===================================================================
--- imagecache.module	(revision 105)
+++ imagecache.module	(working copy)
@@ -116,6 +116,10 @@
       'file' => 'imagecache_actions.inc',
       'arguments' => array('element' => NULL),
     ),
+    'imagecache_sharpen' => array(
+      'file' => 'imagecache_actions.inc',
+      'arguments' => array('element' => NULL),
+    ),
   );
 
   foreach (imagecache_presets() as $preset) {
@@ -195,6 +199,11 @@
       'description' => 'Rotate an image.',
       'file' => 'imagecache_actions.inc',
     ),
+    'imagecache_sharpen' => array(
+      'name' => 'Sharpen',
+      'description' => 'Sharpen an image.',
+      'file' => 'imagecache_actions.inc',
+    ),
   );
 
   return $actions;
Index: imagecache_actions.inc
===================================================================
--- imagecache_actions.inc	(revision 102)
+++ imagecache_actions.inc	(working copy)
@@ -238,3 +238,59 @@
   }
   return true;
 }
+
+/**
+ * Imagecache Sharpen
+ */
+function imagecache_sharpen_form($data) {
+  $form['info'] = array(
+    '#value' => t('<strong>NOTE:</strong> The following parameters are <em>only</em> used when the Imagemagick toolkit is active.  If the GD toolkit is active then sharpening is just performed via a simple, fixed convolution matrix that ignores the values below.'),
+  );
+  $form['radius'] = array(
+    '#type' => 'textfield',
+    '#default_value' => (isset($data['radius'])) ? $data['radius'] : '0' ,
+    '#title' => t('Radius'),
+    '#description' => t('The radius of the Gaussian, in pixels, not counting the center pixel (default 0).'),
+  );
+  $form['sigma'] = array(
+    '#type' => 'textfield',
+    '#default_value' => (isset($data['sigma'])) ? $data['sigma'] : '1.0' ,
+    '#title' => t('Sigma'),
+    '#description' => t('The standard deviation of the Gaussian, in pixels (default 1.0).'),
+  );
+  $form['amount'] = array(
+    '#type' => 'textfield',
+    '#default_value' => (isset($data['amount'])) ? $data['amount'] : '1.0' ,
+    '#title' => t('Amount'),
+    '#description' => t('The percentage of the difference between the original and the blur image that is added back into the original (default 1.0).'),
+  );
+  $form['threshold'] = array(
+    '#type' => 'textfield',
+    '#default_value' => (isset($data['threshold'])) ? $data['threshold'] : '0.05' ,
+    '#title' => t('Threshold'),
+    '#description' => t('The threshold, as a fraction of QuantumRange, needed to apply the difference amount (default 0.05).'),
+  );
+  return $form;
+}
+
+function theme_imagecache_sharpen($element) {
+  $output = t('radius: ') . $element['#value']['radius'] .', ';
+  $output .= t('sigma: ') . $element['#value']['sigma'] .', ';
+  $output .= t('amount: ') . $element['#value']['amount'] .', ';
+  $output .= t('threshold: ') . $element['#value']['threshold'] ;
+  return $output;
+}
+
+function imagecache_sharpen_image(&$image, $data) {
+  // Set sane default values.
+  $data['radius'] = $data['radius'] ? $data['radius'] : "0";
+  $data['sigma'] = $data['sigma'] ? $data['sigma'] : "1.0";
+  $data['amount'] = $data['amount'] ? $data['amount'] : "1.0";
+  $data['threshold'] = $data['threshold'] ? $data['threshold'] : "0.05";
+
+  if (!imageapi_image_sharpen($image, $data['radius'], $data['sigma'], $data['amount'], $data['threshold'])) {
+    watchdog('imagecache', t('imagecache_sharpen_image failed. image: %image, data: %data.', array('%path' => $image, '%data' => print_r($data, true))), WATCHDOG_ERROR);
+    return false;
+  }
+  return true;
+}
\ No newline at end of file
