Start basic AU loader code
[carla.git] / resources / bitmaps / keyboard / export.sh
blob673a0cc574ccd63a88c42d92eb7c5d26ced6a4f4
1 #! /bin/bash
2 # Export several areas in keyboard.svg to optimized PNG.
3 # Dependencies: Inkscape, pngcrush.
5 # IDs of target area rectangles in keyboard.svg:
6 IDs="
7 white_bright_normal
8 white_bright_hover
9 white_bright_on_red
10 white_bright_on_orange
11 white_bright_on_green
12 white_bright_on_blue
13 white_dark_normal
14 white_dark_hover
15 white_dark_on_red
16 white_dark_on_orange
17 white_dark_on_green
18 white_dark_on_blue
19 black_normal
20 black_hover
21 black_on_red
22 black_on_orange
23 black_on_green
24 black_on_blue
27 # Export images:
28 for ID in $IDs; do
29 inkscape keyboard.svg --export-id=$ID --export-png=$ID.png
30 done
32 # Optimize opaque images and remove their alpha channels.
33 # pngcrush will not overwrite input files, so use a temp dir
34 # and move/overwrite files afterwards.
35 # pngcrush creates the dir given for -d, if necessary.
36 pngcrush -c 2 -reduce -d crushed white_*.png
38 # Optimize transparent images, keeping their alpha channels:
39 pngcrush -c 6 -reduce -d crushed black_*.png
41 # Cleanup:
42 mv crushed/*.png .
43 rmdir crushed