labs / diagrams_source /
..
clipart Add H2 icon 1 month ago
lab02 Embed diagram fonts 2 months ago
lab07 Finish lab 7 1 month ago
lab09 General clean up. Embed images. Add icon macro. 12 months ago
sequence_tutorial Improvements to sequence tutorial. 9 months ago
README.txt Complete lab 2 2 months ago
README.txt
This is where we put the original versions of images so that we can update them if needed.

_opt versions of the files are compressed/optimised and are the versions that are embedded in the Wiki.

Optimizing SVG files:

svgcleaner seems to be the best tool for reliably shrinkifying SVG files (does a better job of using groups to apply shared styles than scour):

https://github.com/RazrFalcon/svgcleaner

Available in Arch as community/svgcleaner.

Run using:

svgcleaner --multipass --coordinates-precision 3 --properties-precision 3 --transforms-precision 3 --paths-coordinates-precision 5 file.svg file_opt.svg

if you want the output in a human readable form so that it can be hand-tweaked, the best bet is xmlstarlet (svgcleaner can indent, but it doesn't always put line breaks where you need them):

cat file_opt.svg | xmlstarlet fo

Once tweaked, you can use the following to strip the indentation:

cat file_opt.svg | xmlstarlet fo -n | tr -d '\n' > final.svg

Optimising PNG files:

oxipng seems to be the best of the commonly available PNG optimisers.  It has support for Zopfli which generally offers better compression than zlib.

https://github.com/shssoichiro/oxipng

Available in Arch as community/oxipng.

Run using:

oxipng --strip safe --alpha --zopfli -o max --out file_opt.png file.png