Updated optimize-svg.sh script and optimize SVG files.
You can check pixel diff in Git Cola.
No Linters Available |
No Unit Test Coverage |
Buildable 25639 | |
Build 25657: arc lint + arc unit |
You can check pixel diff in Git Cola.
How do I do this? I was not aware of that feature.
If we're going to actually use the optimization script, we should use scour instead of SVGO. Scour is the SVG optimizer that is least likely to screw up and SVG. These days, the purpose of SVG optimization is to make the code readable.
The Scour settings I recommend are --set-precision=8 --enable-viewboxing --enable-comment-stripping --remove-descriptive-elements --create-groups --strip-xml-space --strip-xml-prolog --nindent=4
In D29072#654216, @ndavis wrote:If we're going to actually use the optimization script, we should use scour instead of SVGO. Scour is the SVG optimizer that is least likely to screw up and SVG. These days, the purpose of SVG optimization is to make the code readable.
Perhaps the script should be updated to do that?
I do try scour but the result is disappointing. I get 16 times the following error:
huuuuge difference of 123 in ./icons-dark/apps/48/hwinfo.svg
which means 16 icons are unacceptable after scour optimization
In D29072#654363, @guoyunhe wrote:I do try scour but the result is disappointing. I get 16 times the following error:
huuuuge difference of 123 in ./icons-dark/apps/48/hwinfo.svgwhich means 16 icons are unacceptable after scour optimization
That's not true. Huge difference means you should make sure you know what the difference is, but most of the time it's perfectly fine. Or maybe the script just isn't working right.
The diff compare is based on Inkscape PNG output. And you can also check git cola's pixel diff, the diff of icons-dark/actions/22/color-management.svg looks like this (black means no difference):
The scour solution is D29159
Commit | Tree | Parents | Author | Summary | Date |
---|---|---|---|---|---|
ba3c57873a61 | fdd2cedab555 | 27fb93d84c2c | Guo Yunhe | Optimize SVG (Show More…) | Apr 21 2020, 8:42 PM |