diff --git a/signwriter.module b/signwriter.module
index f78a6e65f280455835634db4d342c233542b904e..d07e995f2e213503b6af062f47ef4340d9360753 100644
--- a/signwriter.module
+++ b/signwriter.module
@@ -753,14 +753,13 @@ function signwriter_create_image($image, $profile, $width, $height) {
     if ($image->border[$idx]) {
       $image->border_color[$idx] = imagecolorallocate($image->im, $image->border_rgb[$idx][0], $image->border_rgb[$idx][1], $image->border_rgb[$idx][2]);
     }
-  }
-
-  // set the transparent color
-  if ($image->transparent) {
-    // the background is transparent, but it should be the same colour as
-    // whatever the image is over, otherwise you will get jagged edges
-    // (unless you're using png).
-    imagecolortransparent($image->im, $image->background[0]);
+    // set the transparent color
+    if ($image->transparent[$idx]) {
+      // the background is transparent, but it should be the same colour as
+      // whatever the image is over, otherwise you will get jagged edges
+      // (unless you're using png).
+      imagecolortransparent($image->im, $image->background[$idx]);
+    }
   }
 }
 
@@ -796,7 +795,7 @@ function signwriter_render_text($image, $idx, $xofs, $yofs, $width, $height) {
   $angle = 0;
   $box = $image->box;
 
-  if (!$image->transparent && empty($image->bgimage[$idx])) {
+  if (!$image->transparent[$idx] && empty($image->bgimage[$idx])) {
     imagefilledrectangle ($image->im, $xofs, $yofs , $xofs + $width, $yofs+ $height, $image->background[$idx]);
   }
 
