Index: /applications/editors/josm/plugins/imagery/src/org/openstreetmap/josm/plugins/imagery/ImageryPreferenceEditor.java
===================================================================
--- /applications/editors/josm/plugins/imagery/src/org/openstreetmap/josm/plugins/imagery/ImageryPreferenceEditor.java	(revision 24547)
+++ /applications/editors/josm/plugins/imagery/src/org/openstreetmap/josm/plugins/imagery/ImageryPreferenceEditor.java	(revision 24548)
@@ -4,4 +4,5 @@
 import static org.openstreetmap.josm.tools.I18n.trc;
 
+import java.awt.Color;
 import java.awt.Component;
 import java.awt.Dimension;
@@ -22,4 +23,5 @@
 import javax.swing.JButton;
 import javax.swing.JCheckBox;
+import javax.swing.JColorChooser;
 import javax.swing.JComboBox;
 import javax.swing.JEditorPane;
@@ -44,4 +46,5 @@
 import org.openstreetmap.josm.plugins.imagery.wms.AddWMSLayerPanel;
 import org.openstreetmap.josm.plugins.imagery.wms.WMSAdapter;
+import org.openstreetmap.josm.tools.ColorHelper;
 import org.openstreetmap.josm.tools.GBC;
 
@@ -50,4 +53,10 @@
     private JComboBox browser;
 
+    // Common settings
+    private Color colFadeColor;
+    private JButton btnFadeColor;
+    private JSlider fadeAmount = new JSlider(0, 100);
+
+    // WMS Settings
     JCheckBox overlapCheckBox;
     JSpinner spinEast;
@@ -62,7 +71,6 @@
     private JCheckBox autozoomActive = new JCheckBox();
     private JCheckBox autoloadTiles = new JCheckBox();
+    private JSpinner minZoomLvl;
     private JSpinner maxZoomLvl;
-    private JSpinner minZoomLvl = new JSpinner();
-    private JSlider fadeBackground = new JSlider(0, 100);
 
 
@@ -186,6 +194,43 @@
     }
 
+    private JPanel buildCommonSettingsPanel(final PreferenceTabbedPane gui) {
+        final JPanel p = new JPanel(new GridBagLayout());
+
+        this.colFadeColor = ImageryPreferences.getFadeColor();
+        this.btnFadeColor = new JButton();
+        this.btnFadeColor.setBackground(colFadeColor);
+        this.btnFadeColor.setText(ColorHelper.color2html(colFadeColor));
+
+        this.btnFadeColor.addActionListener(new ActionListener() {
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                JColorChooser chooser = new JColorChooser(colFadeColor);
+                int answer = JOptionPane.showConfirmDialog(
+                        gui, chooser,
+                        tr("Choose a color for {0}", tr("imagery fade")),
+                        JOptionPane.OK_CANCEL_OPTION,
+                        JOptionPane.PLAIN_MESSAGE);
+                if (answer == JOptionPane.OK_OPTION) {
+                    colFadeColor = chooser.getColor();
+                    btnFadeColor.setBackground(colFadeColor);
+                    btnFadeColor.setText(ColorHelper.color2html(colFadeColor));
+                }
+            }
+        });
+
+        p.add(new JLabel(tr("Fade Color: ")), GBC.std());
+        p.add(GBC.glue(5, 0), GBC.std().fill(GBC.HORIZONTAL));
+        p.add(this.btnFadeColor, GBC.eol().fill(GBC.HORIZONTAL));
+
+        p.add(new JLabel(tr("Fade amount: ")), GBC.std());
+        p.add(GBC.glue(5, 0), GBC.std().fill(GBC.HORIZONTAL));
+        p.add(this.fadeAmount, GBC.eol().fill(GBC.HORIZONTAL));
+
+        this.fadeAmount.setValue(ImageryPreferences.PROP_FADE_AMOUNT.get());
+        return p;
+    }
+
     private JPanel buildWMSSettingsPanel() {
-        final JPanel pnlW = new JPanel(new GridBagLayout());
+        final JPanel p = new JPanel(new GridBagLayout());
         browser = new JComboBox(new String[] {
                 "webkit-image {0}",
@@ -195,9 +240,9 @@
         browser.setEditable(true);
         browser.setSelectedItem(Main.pref.get("wmsplugin.browser", "webkit-image {0}"));
-        pnlW.add(new JLabel(tr("Downloader:")), GBC.eol().fill(GBC.HORIZONTAL));
-        pnlW.add(browser);
+        p.add(new JLabel(tr("Downloader:")), GBC.eol().fill(GBC.HORIZONTAL));
+        p.add(browser);
 
         // Overlap
-        pnlW.add(Box.createHorizontalGlue(), GBC.eol().fill(GBC.HORIZONTAL));
+        p.add(Box.createHorizontalGlue(), GBC.eol().fill(GBC.HORIZONTAL));
 
         overlapCheckBox = new JCheckBox(tr("Overlap tiles"), wmsAdapter.PROP_OVERLAP.get());
@@ -214,8 +259,8 @@
         overlapPanel.add(spinNorth);
 
-        pnlW.add(overlapPanel);
+        p.add(overlapPanel);
 
         // Simultaneous connections
-        pnlW.add(Box.createHorizontalGlue(), GBC.eol().fill(GBC.HORIZONTAL));
+        p.add(Box.createHorizontalGlue(), GBC.eol().fill(GBC.HORIZONTAL));
         JLabel labelSimConn = new JLabel(tr("Simultaneous connections"));
         spinSimConn = new JSpinner(new SpinnerNumberModel(wmsAdapter.PROP_SIMULTANEOUS_CONNECTIONS.get(), 1, 30, 1));
@@ -223,5 +268,5 @@
         overlapPanelSimConn.add(labelSimConn);
         overlapPanelSimConn.add(spinSimConn);
-        pnlW.add(overlapPanelSimConn, GBC.eol().fill(GBC.HORIZONTAL));
+        p.add(overlapPanelSimConn, GBC.eol().fill(GBC.HORIZONTAL));
 
         allowRemoteControl = Main.pref.getBoolean("wmsplugin.remotecontrol", true);
@@ -230,6 +275,6 @@
         remotePanel.add(remoteCheckBox);
 
-        pnlW.add(remotePanel,GBC.eol().fill(GBC.HORIZONTAL));
-        return pnlW;
+        p.add(remotePanel,GBC.eol().fill(GBC.HORIZONTAL));
+        return p;
     }
 
@@ -255,8 +300,4 @@
         tmsTab.add(this.maxZoomLvl, GBC.eol().fill(GBC.HORIZONTAL));
 
-        tmsTab.add(new JLabel(tr("Fade background: ")), GBC.std());
-        tmsTab.add(GBC.glue(5, 0), GBC.std().fill(GBC.HORIZONTAL));
-        tmsTab.add(this.fadeBackground, GBC.eol().fill(GBC.HORIZONTAL));
-
         tmsTab.add(Box.createVerticalGlue(), GBC.eol().fill(GBC.VERTICAL));
 
@@ -265,24 +306,22 @@
         this.maxZoomLvl.setValue(TMSPreferences.getMaxZoomLvl(null));
         this.minZoomLvl.setValue(TMSPreferences.getMinZoomLvl(null));
-        this.fadeBackground.setValue(TMSPreferences.PROP_FADE_BACKGROUND.get());
         return tmsTab;
     }
 
-    private Component buildSettingsPanel() {
-        // TODO: make some settings common for WMS and TMS
+    private void addSettingsSection(final JPanel p, String name, JPanel section) {
+        final JLabel lbl = new JLabel(name);
+        lbl.setFont(lbl.getFont().deriveFont(Font.BOLD));
+        p.add(lbl);
+        p.add(new JSeparator(), GBC.eol().fill(GBC.HORIZONTAL).insets(5, 0, 0, 0));
+        p.add(section,GBC.eol().insets(20,5,0,5));
+    }
+
+    private Component buildSettingsPanel(final PreferenceTabbedPane gui) {
         final JPanel p = new JPanel(new GridBagLayout());
         p.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
 
-        final JLabel lblW = new JLabel(tr("WMS Settings"));
-        lblW.setFont(lblW.getFont().deriveFont(Font.BOLD));
-        p.add(lblW);
-        p.add(new JSeparator(), GBC.eol().fill(GBC.HORIZONTAL).insets(5, 0, 0, 0));
-        p.add(buildWMSSettingsPanel(),GBC.eol().insets(20,5,0,0));
-
-        final JLabel lblT = new JLabel(tr("TMS Settings"));
-        lblT.setFont(lblT.getFont().deriveFont(Font.BOLD));
-        p.add(lblT);
-        p.add(new JSeparator(), GBC.eol().fill(GBC.HORIZONTAL).insets(5, 0, 0, 0));
-        p.add(buildTMSSettingsPanel(),GBC.eol().insets(20,5,0,0));
+        addSettingsSection(p, tr("Common Settings"), buildCommonSettingsPanel(gui));
+        addSettingsSection(p, tr("WMS Settings"), buildWMSSettingsPanel());
+        addSettingsSection(p, tr("TMS Settings"), buildTMSSettingsPanel());
 
         p.add(new JPanel(),GBC.eol().fill(GBC.BOTH));
@@ -295,5 +334,5 @@
         JTabbedPane pane = new JTabbedPane();
         pane.add(buildImageryProvidersPanel(gui));
-        pane.add(buildSettingsPanel());
+        pane.add(buildSettingsPanel(gui));
         pane.setTitleAt(0, tr("Imagery providers"));
         pane.setTitleAt(1, tr("Settings"));
@@ -320,5 +359,7 @@
         TMSPreferences.setMaxZoomLvl((Integer)this.maxZoomLvl.getValue());
         TMSPreferences.setMinZoomLvl((Integer)this.minZoomLvl.getValue());
-        TMSPreferences.PROP_FADE_BACKGROUND.put(this.fadeBackground.getValue());
+
+        ImageryPreferences.PROP_FADE_AMOUNT.put(this.fadeAmount.getValue());
+        ImageryPreferences.setFadeColor(this.colFadeColor);
 
         return false;
Index: /applications/editors/josm/plugins/imagery/src/org/openstreetmap/josm/plugins/imagery/ImageryPreferences.java
===================================================================
--- /applications/editors/josm/plugins/imagery/src/org/openstreetmap/josm/plugins/imagery/ImageryPreferences.java	(revision 24548)
+++ /applications/editors/josm/plugins/imagery/src/org/openstreetmap/josm/plugins/imagery/ImageryPreferences.java	(revision 24548)
@@ -0,0 +1,26 @@
+package org.openstreetmap.josm.plugins.imagery;
+
+import java.awt.Color;
+
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.data.preferences.IntegerProperty;
+
+public class ImageryPreferences {
+
+    public static final IntegerProperty PROP_FADE_AMOUNT = new IntegerProperty("imagery.fade_amount", 0);
+
+    public static Color getFadeColor() {
+        return Main.pref.getColor("imagery.fade", Color.white);
+    }
+
+    public static Color getFadeColorWithAlpha() {
+        Color c = getFadeColor();
+        return new Color(c.getRed(),c.getGreen(),c.getBlue(),PROP_FADE_AMOUNT.get()*255/100);
+    }
+
+    public static void setFadeColor(Color color) {
+        Main.pref.putColor("imagery.fade", color);
+    }
+
+
+}
Index: /applications/editors/josm/plugins/imagery/src/org/openstreetmap/josm/plugins/imagery/tms/TMSLayer.java
===================================================================
--- /applications/editors/josm/plugins/imagery/src/org/openstreetmap/josm/plugins/imagery/tms/TMSLayer.java	(revision 24547)
+++ /applications/editors/josm/plugins/imagery/src/org/openstreetmap/josm/plugins/imagery/tms/TMSLayer.java	(revision 24548)
@@ -53,6 +53,7 @@
 import org.openstreetmap.josm.gui.layer.Layer;
 import org.openstreetmap.josm.plugins.imagery.ImageryInfo;
+import org.openstreetmap.josm.plugins.imagery.ImageryInfo.ImageryType;
 import org.openstreetmap.josm.plugins.imagery.ImageryLayer;
-import org.openstreetmap.josm.plugins.imagery.ImageryInfo.ImageryType;
+import org.openstreetmap.josm.plugins.imagery.ImageryPreferences;
 
 /**
@@ -690,9 +691,7 @@
                         img_x_end, img_y_end,
                         this);
-        float fadeBackground = TMSPreferences.getFadeBackground();
-        if (fadeBackground != 0f) {
+        if (ImageryPreferences.PROP_FADE_AMOUNT.get() != 0) {
             // dimm by painting opaque rect...
-            // TODO: make fade color configurable and implement same feature for WMS layers
-            g.setColor(new Color(1f, 1f, 1f, fadeBackground));
+            g.setColor(ImageryPreferences.getFadeColorWithAlpha());
             g.fillRect(target.x, target.y,
                        target.width, target.height);
Index: /applications/editors/josm/plugins/imagery/src/org/openstreetmap/josm/plugins/imagery/tms/TMSPreferences.java
===================================================================
--- /applications/editors/josm/plugins/imagery/src/org/openstreetmap/josm/plugins/imagery/tms/TMSPreferences.java	(revision 24547)
+++ /applications/editors/josm/plugins/imagery/src/org/openstreetmap/josm/plugins/imagery/tms/TMSPreferences.java	(revision 24548)
@@ -26,26 +26,5 @@
     public static final IntegerProperty PROP_MIN_ZOOM_LVL = new IntegerProperty(PREFERENCE_PREFIX + ".min_zoom_lvl", DEFAULT_MIN_ZOOM);
     public static final IntegerProperty PROP_MAX_ZOOM_LVL = new IntegerProperty(PREFERENCE_PREFIX + ".max_zoom_lvl", DEFAULT_MAX_ZOOM);
-    public static final IntegerProperty PROP_FADE_BACKGROUND = new IntegerProperty(PREFERENCE_PREFIX + ".fade_background", 0);
     public static final BooleanProperty PROP_DRAW_DEBUG = new BooleanProperty(PREFERENCE_PREFIX + ".draw_debug", false);
-
-    public static void setFadeBackground(float fadeBackground) {
-        PROP_FADE_BACKGROUND.put(Math.round(fadeBackground*100));
-    }
-
-    /**
-     *
-     * @return  number between 0 and 1, inclusive
-     */
-    public static float getFadeBackground() {
-        float parsed = (PROP_FADE_BACKGROUND.get())/100.0f;
-        if(parsed < 0f) {
-            parsed = 0f;
-        } else {
-            if(parsed > 1f) {
-                parsed = 1f;
-            }
-        }
-        return parsed;
-    }
 
     static int checkMaxZoomLvl(int maxZoomLvl, TileSource ts)
Index: /applications/editors/josm/plugins/imagery/src/org/openstreetmap/josm/plugins/imagery/wms/GeorefImage.java
===================================================================
--- /applications/editors/josm/plugins/imagery/src/org/openstreetmap/josm/plugins/imagery/wms/GeorefImage.java	(revision 24547)
+++ /applications/editors/josm/plugins/imagery/src/org/openstreetmap/josm/plugins/imagery/wms/GeorefImage.java	(revision 24548)
@@ -19,4 +19,5 @@
 import org.openstreetmap.josm.data.coor.EastNorth;
 import org.openstreetmap.josm.gui.NavigatableComponent;
+import org.openstreetmap.josm.plugins.imagery.ImageryPreferences;
 
 public class GeorefImage implements Serializable {
@@ -33,4 +34,6 @@
     private int yIndex;
 
+    private static final Color transparentColor = new Color(0,0,0,0);
+    private Color fadeColor = transparentColor;
 
     public EastNorth getMin() {
@@ -122,9 +125,18 @@
             return false;
 
+        // TODO: implement per-layer fade color
+        Color newFadeColor;
+        if (ImageryPreferences.PROP_FADE_AMOUNT.get() == 0)
+            newFadeColor = transparentColor;
+        else
+            newFadeColor = ImageryPreferences.getFadeColorWithAlpha();
+
         BufferedImage img = reImg == null?null:reImg.get();
-        if(img != null && img.getWidth() == width && img.getHeight() == height) {
+        if(img != null && img.getWidth() == width && img.getHeight() == height && fadeColor.equals(newFadeColor)) {
             g.drawImage(img, x, y, null);
             return true;
         }
+
+        fadeColor = newFadeColor;
 
         boolean alphaChannel = WMSLayer.PROP_ALPHA_CHANNEL.get() && getImage().getTransparency() != Transparency.OPAQUE;
@@ -143,5 +155,5 @@
             // Also prevent caching if we're out of memory soon
             if(width > 2000 || height > 2000 || width*height*multipl > freeMem) {
-                fallbackDraw(g, getImage(), x, y, width, height);
+                fallbackDraw(g, getImage(), x, y, width, height, alphaChannel);
             } else {
                 // We haven't got a saved resized copy, so resize and cache it
@@ -151,4 +163,7 @@
                         0, 0, getImage().getWidth(null), getImage().getHeight(null), // src
                         null);
+                if (!alphaChannel) {
+                    drawFadeRect(img.getGraphics(), 0, 0, width, height);
+                }
                 img.getGraphics().dispose();
                 g.drawImage(img, x, y, null);
@@ -156,10 +171,10 @@
             }
         } catch(Exception e) {
-            fallbackDraw(g, getImage(), x, y, width, height);
+            fallbackDraw(g, getImage(), x, y, width, height, alphaChannel);
         }
         return true;
     }
 
-    private void fallbackDraw(Graphics g, Image img, int x, int y, int width, int height) {
+    private void fallbackDraw(Graphics g, Image img, int x, int y, int width, int height, boolean alphaChannel) {
         flushedResizedCachedInstance();
         g.drawImage(
@@ -167,4 +182,14 @@
                 0, 0, img.getWidth(null), img.getHeight(null),
                 null);
+        if (!alphaChannel) { //FIXME: fading for layers with alpha channel currently is not supported
+            drawFadeRect(g, x, y, width, height);
+        }
+    }
+
+    private void drawFadeRect(Graphics g, int x, int y, int width, int height) {
+        if (fadeColor != transparentColor) {
+            g.setColor(fadeColor);
+            g.fillRect(x, y, width, height);
+        }
     }
 
