Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
999B

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