diff --git a/image_template.html b/image_template.html
index 07674db33edfe2511ab67010e46c2f00ded3b800..ba4354779c5fcc88a4c4fa9efbf98d4472dc4155 100644
--- a/image_template.html
+++ b/image_template.html
@@ -11,17 +11,9 @@
 ${OCR_CONTENT}
 ${IDNEXTS}
 ${IDPREVS}
+    blackoverlayurl = "${BLACK}";
+    whiteoverlayurl = "${WHITE}";
     </script>
-    <style>
-      .whiteoverlay {
-        background: url(${WHITE});
-        background-size: 100% auto;
-      }
-      .blackoverlay {
-        background: url(${BLACK});
-        background-size: 100% auto;
-      }
-    </style>
 </head>
 
 <body class="previewpage">
diff --git a/quack.css b/quack.css
index 55a637273e84e8aae6c6c3fad19bcbfb889b690d..107ad84c77909a41c0740dff6ccf8e70de018fca 100644
--- a/quack.css
+++ b/quack.css
@@ -137,8 +137,8 @@ ul.alternatives li + li:before {
     border: 1px dotted grey;
 }
 
-.whiteoverlay {
-    background-size: 100% 100%;
+.whiteoverlay, .blackoverlay {
+    background-size: 100% auto;
     pointer-events: none;
 }
 
diff --git a/quack.js b/quack.js
index e2b3495bdcbcc12fb3b227b89dfeac25ff12006d..fdb5d45576c3ca47ef16ce924ca9896cc7ccf558 100644
--- a/quack.js
+++ b/quack.js
@@ -36,10 +36,16 @@ function toggleBlown() {
     
     var content = document.getElementsByClassName('whiteoverlay');
     for (var i = 0 ; i < content.length ; i++) {
+        if (content[i].style.backgroundImage == '' && state == 'block') {
+            content[i].style.backgroundImage = "url('" + whiteoverlayurl + "')";
+        }
         content[i].style.display = state;
     }
     var content = document.getElementsByClassName('blackoverlay');
     for (var i = 0 ; i < content.length ; i++) {
+        if (content[i].style.backgroundImage == '' && state == 'block') {
+            content[i].style.backgroundImage = "url('" + blackoverlayurl + "')";
+        }
         content[i].style.display = state;
     }
 }
diff --git a/quack.sh b/quack.sh
index eb9b62858e6adfd990b8074d24f0b02b55f10fd9..71aaa11c5e2a9a20c1f17c732e9d14a6688f633c 100755
--- a/quack.sh
+++ b/quack.sh
@@ -127,7 +127,13 @@ TILE="false"
 # downscaled, levelled, sharpened and JPEG'ed.
 PRESENTATION="true"
 
+# Overlay colors for indicating burned out high- and low-lights
+export OVERLAY_BLACK=3399FF
+export OVERLAY_WHITE=FFFF00
+
 # End default settings. User-supplied overrides will be loaded from quack.settings
+
+
 pushd `dirname $0` > /dev/null
 ROOT=`pwd`
 if [ -e "quack.settings" ]; then
@@ -319,11 +325,11 @@ function makeImages() {
     fi
 
     if shouldGenerate "$FORCE_BLOWN" "$WHITE_IMAGE" "overlay"; then
-        gm convert "$CONV" -black-threshold 255,255,255 -white-threshold 254,254,254 -negate -fill \#FF0000 -opaque black -transparent white -colors 2 "$WHITE_IMAGE"
+        gm convert "$CONV" -black-threshold 255,255,255 -white-threshold 254,254,254 -negate -fill \#$OVERLAY_WHITE -opaque black -transparent white -colors 2 "$WHITE_IMAGE"
     fi
 
     if shouldGenerate "$FORCE_BLOWN" "$BLACK_IMAGE" "overlay"; then
-        gm convert "$CONV" -black-threshold 1,1,1 -white-threshold 0,0,0 -fill \#0000FF -opaque black -transparent white -colors 2 "$BLACK_IMAGE"
+        gm convert "$CONV" -black-threshold 1,1,1 -white-threshold 0,0,0 -fill \#$OVERLAY_BLACK -opaque black -transparent white -colors 2 "$BLACK_IMAGE"
     fi
 
     if [ ".true" == ".$PRESENTATION" ]; then
@@ -653,8 +659,8 @@ function makePreviewPage() {
         template "$IHTML" "PRESENTATION_HEIGHT" "$PRESENTATION_HEIGHT"
     else
         template "$IHTML" "PRESENTATION" ""
-        template "$IHTML" "PRESENTATION_WIDTH" ""
-        template "$IHTML" "PRESENTATION_HEIGHT" ""
+        template "$IHTML" "PRESENTATION_WIDTH" "0"
+        template "$IHTML" "PRESENTATION_HEIGHT" "0"
     fi
     WHITE_LINK=${WHITE_IMAGE##*/}
     template "$IHTML" "WHITE" "$WHITE_LINK"