diff --git a/includes/image.inc b/includes/image.inc
index b04943b..604bac5 100644
--- a/includes/image.inc
+++ b/includes/image.inc
@@ -90,10 +90,11 @@ function image_get_toolkit() {
  * @return
  *   Mixed values (typically Boolean indicating successful operation).
  */
-function image_toolkit_invoke($method, stdClass $image, array $params = array()) {
+function image_toolkit_invoke($method, stdClass $image, array $params = array(), $style = array()) {
   $function = 'image_' . $image->toolkit . '_' . $method;
   if (function_exists($function)) {
     array_unshift($params, $image);
+    $params['style'] = $style;
     return call_user_func_array($function, $params);
   }
   watchdog('image', 'The selected image handling toolkit %toolkit can not correctly process %function.', array('%toolkit' => $image->toolkit, '%function' => $function), WATCHDOG_ERROR);
@@ -377,6 +378,9 @@ function image_load($file, $toolkit = FALSE) {
  * @param $destination
  *   Destination path where the image should be saved. If it is empty the
  *   original image file will be overwritten.
+ * @param $style
+ *   An array that contains style settings for this image, which has been
+ *   defined in the image styles admin page.
  *
  * @return
  *   TRUE or FALSE, based on success.
@@ -384,11 +388,11 @@ function image_load($file, $toolkit = FALSE) {
  * @see image_load()
  * @see image_gd_save()
  */
-function image_save(stdClass $image, $destination = NULL) {
+function image_save(stdClass $image, $destination = NULL, $style = '') {
   if (empty($destination)) {
     $destination = $image->source;
   }
-  if ($return = image_toolkit_invoke('save', $image, array($destination))) {
+  if ($return = image_toolkit_invoke('save', $image, array($destination), $style)) {
     // Clear the cached file size and refresh the image information.
     clearstatcache();
     $image->info = image_get_info($destination, $image->toolkit);
diff --git a/modules/image/image.module b/modules/image/image.module
index 008a365..56f17be 100644
--- a/modules/image/image.module
+++ b/modules/image/image.module
@@ -800,14 +800,13 @@ function image_style_create_derivative($style, $source, $destination) {
   foreach ($style['effects'] as $effect) {
     image_effect_apply($image, $effect);
   }
-
-  if (!image_save($image, $destination)) {
+  
+  if (!image_save($image, $destination, $style)) {
     if (file_exists($destination)) {
       watchdog('image', 'Cached image file %destination already exists. There may be an issue with your rewrite configuration.', array('%destination' => $destination), WATCHDOG_ERROR);
     }
     return FALSE;
   }
-
   return TRUE;
 }
 
diff --git a/modules/system/image.gd.inc b/modules/system/image.gd.inc
index 39f86dc..10336aa 100644
--- a/modules/system/image.gd.inc
+++ b/modules/system/image.gd.inc
@@ -244,12 +244,14 @@ function image_gd_load(stdClass $image) {
  *   An image object.
  * @param $destination
  *   A string file URI or path where the image should be saved.
+ * @param $style
+ *   An array of style settings for this image.
  * @return
  *   TRUE or FALSE, based on success.
  *
  * @see image_save()
  */
-function image_gd_save(stdClass $image, $destination) {
+function image_gd_save(stdClass $image, $destination, $style) {
   $scheme = file_uri_scheme($destination);
   // Work around lack of stream wrapper support in imagejpeg() and imagepng().
   if ($scheme && file_stream_wrapper_valid_scheme($scheme)) {
@@ -269,7 +271,11 @@ function image_gd_save(stdClass $image, $destination) {
     return FALSE;
   }
   if ($extension == 'jpeg') {
-    $success = $function($image->resource, $destination, variable_get('image_jpeg_quality', 75));
+
+    $quality = variable_get('imageapi_jpeg_quality', 75);
+    // Allow other modules to alter the image quality
+    drupal_alter('image_quality', $style, $quality);
+    $success = $function($image->resource, $destination, $quality);
   }
   else {
     // Always save PNG images with full transparency.
