diff --git a/resources/bitmaps/kbd_h_dark.png b/resources/bitmaps/kbd_h_dark.png
index 7de0b18e0..ba34dff2b 100644
Binary files a/resources/bitmaps/kbd_h_dark.png and b/resources/bitmaps/kbd_h_dark.png differ
diff --git a/resources/bitmaps/kbd_v_dark.png b/resources/bitmaps/kbd_v_dark.png
index b416242e2..3963f2e0a 100644
Binary files a/resources/bitmaps/kbd_v_dark.png and b/resources/bitmaps/kbd_v_dark.png differ
diff --git a/resources/bitmaps/keyboard/black_hover.png b/resources/bitmaps/keyboard/black_hover.png
index 2cc67f48e..978f72ab8 100644
Binary files a/resources/bitmaps/keyboard/black_hover.png and b/resources/bitmaps/keyboard/black_hover.png differ
diff --git a/resources/bitmaps/keyboard/black_normal.png b/resources/bitmaps/keyboard/black_normal.png
index 9b89fca34..759a8f541 100644
Binary files a/resources/bitmaps/keyboard/black_normal.png and b/resources/bitmaps/keyboard/black_normal.png differ
diff --git a/resources/bitmaps/keyboard/black_on_blue.png b/resources/bitmaps/keyboard/black_on_blue.png
index aa69f1ad4..5b47af0a2 100644
Binary files a/resources/bitmaps/keyboard/black_on_blue.png and b/resources/bitmaps/keyboard/black_on_blue.png differ
diff --git a/resources/bitmaps/keyboard/black_on_green.png b/resources/bitmaps/keyboard/black_on_green.png
index 4a4784a98..5c265e5a5 100644
Binary files a/resources/bitmaps/keyboard/black_on_green.png and b/resources/bitmaps/keyboard/black_on_green.png differ
diff --git a/resources/bitmaps/keyboard/black_on_orange.png b/resources/bitmaps/keyboard/black_on_orange.png
index b5bc9f2ba..20f5acee8 100644
Binary files a/resources/bitmaps/keyboard/black_on_orange.png and b/resources/bitmaps/keyboard/black_on_orange.png differ
diff --git a/resources/bitmaps/keyboard/black_on_red.png b/resources/bitmaps/keyboard/black_on_red.png
index 0751df031..60cdd35ef 100644
Binary files a/resources/bitmaps/keyboard/black_on_red.png and b/resources/bitmaps/keyboard/black_on_red.png differ
diff --git a/resources/bitmaps/keyboard/bright_sprite.png b/resources/bitmaps/keyboard/bright_sprite.png
new file mode 100644
index 000000000..f7dcf2dbc
Binary files /dev/null and b/resources/bitmaps/keyboard/bright_sprite.png differ
diff --git a/resources/bitmaps/keyboard/export.sh b/resources/bitmaps/keyboard/export.sh
index dc7c9b58a..bb64e569e 100755
--- a/resources/bitmaps/keyboard/export.sh
+++ b/resources/bitmaps/keyboard/export.sh
@@ -1,5 +1,8 @@
-# TODO: split flattable from non-flattable PNGs
+#! /bin/bash
+# Export several areas in keyboard.svg to optimized PNG.
+# Dependencies: Inkscape, pngcrush.
+# IDs of target area rectangles in keyboard.svg:
IDs="
white_bright_normal
white_bright_hover
@@ -21,6 +24,20 @@ black_on_green
black_on_blue
"
+# Export images:
for ID in $IDs; do
inkscape keyboard.svg --export-id=$ID --export-png=$ID.png
done
+
+# Optimize opaque images and remove their alpha channels.
+# pngcrush will not overwrite input files, so use a temp dir
+# and move/overwrite files afterwards.
+# pngcrush creates the dir given for -d, if necessary.
+pngcrush -c 2 -reduce -d crushed white_*.png
+
+# Optimze transparent images, keeping their alpha channels:
+pngcrush -c 6 -reduce -d crushed black_*.png
+
+# Cleanup:
+mv crushed/*.png .
+rmdir crushed
diff --git a/resources/bitmaps/keyboard/join.sh b/resources/bitmaps/keyboard/join.sh
new file mode 100755
index 000000000..e50f68724
--- /dev/null
+++ b/resources/bitmaps/keyboard/join.sh
@@ -0,0 +1,19 @@
+#! /bin/bash
+# Join images vertically, to create a sprite sheat.
+# Dependencies: Imagemagick (convert)
+
+convert white_bright_normal.png \
+ white_bright_hover.png \
+ white_bright_on_red.png \
+ black_normal.png \
+ black_hover.png \
+ black_on_red.png \
+ -append bright_sprite.png
+
+# convert white_dark_normal.png \
+# white_dark_hover.png \
+# white_dark_on_red.png \
+# black_normal.png \
+# black_hover.png \
+# black_on_red.png \
+# -append dark_sprite.png
diff --git a/resources/bitmaps/keyboard/keyboard.svg b/resources/bitmaps/keyboard/keyboard.svg
index 73bc1f3fd..16aa3b73a 100644
--- a/resources/bitmaps/keyboard/keyboard.svg
+++ b/resources/bitmaps/keyboard/keyboard.svg
@@ -14700,116 +14700,6 @@
y1="735.375"
x2="16.25"
y2="731.375" />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
image/svg+xml
-
+
@@ -29078,7 +28737,7 @@
inkscape:groupmode="layer"
id="layer2"
inkscape:label="construction"
- style="display:inline"
+ style="display:none"
transform="translate(144,1259.9872)">
+ style="fill:#b0c714;fill-opacity:1;stroke:none;enable-background:new" />
+ style="fill:#4a8a0e;fill-opacity:1;stroke:none;enable-background:new" />
+ style="fill:#4a8a0e;fill-opacity:1;stroke:none;enable-background:new" />
+ style="fill:#b0c714;fill-opacity:1;stroke:none;enable-background:new" />
+ style="fill:#4a8a0e;fill-opacity:1;stroke:none;enable-background:new" />
+ style="fill:#b0c714;fill-opacity:1;stroke:none;enable-background:new" />