Add script to automatically rescale SVG images - important to export them to PNGs

This commit is contained in:
Pieter Vander Vennet 2022-01-06 20:39:59 +01:00
parent 7090a5ceb8
commit d4f5e1d238
8 changed files with 261 additions and 90 deletions

View file

@ -1,22 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 17.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px"
width="35px" height="32px" viewBox="0 0 35 32" enable-background="new 0 0 35 32" xml:space="preserve">
<g>
<path fill="#828282" d="M27.464,2.314c-0.053-0.132-0.159-0.235-0.292-0.284c-0.133-0.048-0.281-0.039-0.406,0.027L14.86,8.339
c-0.224,0.118-0.324,0.385-0.233,0.621l0.245,0.641L7.999,13.37C7.774,13.493,7.679,13.765,7.777,14l0.228,0.549l-7.299,3.488
c-0.24,0.115-0.348,0.397-0.246,0.643l1.498,3.61c0.08,0.192,0.265,0.309,0.462,0.309c0.056,0,0.112-0.009,0.167-0.029l7.625-2.701
l0.228,0.549c0.079,0.191,0.264,0.309,0.462,0.309c0.046,0,0.092-0.006,0.139-0.02l7.276-2.097l0.218,0.569
C18.609,19.376,18.798,19.5,19,19.5c0.049,0,0.098-0.007,0.147-0.022l13-4c0.134-0.041,0.244-0.136,0.304-0.262
c0.06-0.126,0.065-0.272,0.013-0.401L27.464,2.314z M2.7,21.469l-1.134-2.734l6.823-3.261l1.439,3.47L2.7,21.469z M11.191,19.623
l-0.238-0.574c0,0,0,0,0,0L9.11,14.604c0,0,0,0,0,0l-0.238-0.573l6.336-3.475l2.374,6.134l0.375,0.981L11.191,19.623z M19.3,18.385
l-0.203-0.531c-0.003-0.011-0.001-0.024-0.006-0.035l-0.618-1.597l-2.754-7.206l11.023-5.815l4.592,11.48L19.3,18.385z"/>
<path fill="#828282" d="M28.964,0.314c-0.103-0.257-0.395-0.381-0.65-0.279c-0.256,0.103-0.381,0.394-0.279,0.65l6,15
C34.114,15.881,34.302,16,34.5,16c0.062,0,0.125-0.011,0.186-0.036c0.256-0.103,0.381-0.394,0.279-0.65L28.964,0.314z"/>
<path fill="#828282" d="M18,21h-3c-1.14,0-2,0.86-2,2v1.315l-5.879,6.859c-0.18,0.209-0.156,0.525,0.054,0.705
C7.269,31.96,7.385,32,7.5,32c0.141,0,0.281-0.059,0.379-0.175L13.73,25H16v6.5c0,0.276,0.224,0.5,0.5,0.5s0.5-0.224,0.5-0.5V25
h2.27l5.85,6.825C25.219,31.941,25.359,32,25.5,32c0.115,0,0.231-0.04,0.325-0.121c0.21-0.18,0.234-0.495,0.054-0.705L20,24.315
v-1.24C20,21.912,19.122,21,18,21z M19,24h-5v-1c0-0.589,0.411-1,1-1h3c0.57,0,1,0.462,1,1.075V24z"/>
</g>
</svg>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="374px" height="342px" viewBox="0 0 374 342" version="1.1">
<g id="surface1">
<path style=" stroke:none;fill-rule:nonzero;fill:rgb(50.980395%,50.980395%,50.980395%);fill-opacity:1;" d="M 293.472656 24.730469 C 292.90625 23.320312 291.773438 22.21875 290.351562 21.695312 C 288.929688 21.183594 287.347656 21.277344 286.015625 21.984375 L 158.789062 89.125 C 156.394531 90.382812 155.328125 93.238281 156.300781 95.761719 L 158.917969 102.609375 L 85.476562 142.890625 C 83.070312 144.207031 82.054688 147.113281 83.101562 149.625 L 85.539062 155.492188 L 7.542969 192.769531 C 4.980469 194 3.824219 197.011719 4.914062 199.640625 L 20.921875 238.222656 C 21.777344 240.277344 23.753906 241.527344 25.859375 241.527344 C 26.457031 241.527344 27.054688 241.429688 27.644531 241.21875 L 109.121094 212.351562 L 111.558594 218.21875 C 112.402344 220.257812 114.378906 221.519531 116.496094 221.519531 C 116.988281 221.519531 117.480469 221.457031 117.980469 221.304688 L 195.730469 198.894531 L 198.058594 204.976562 C 198.851562 207.082031 200.871094 208.40625 203.027344 208.40625 C 203.550781 208.40625 204.074219 208.332031 204.597656 208.171875 L 343.511719 165.421875 C 344.945312 164.984375 346.121094 163.96875 346.761719 162.621094 C 347.402344 161.273438 347.457031 159.714844 346.902344 158.335938 Z M 28.851562 229.449219 L 16.734375 200.230469 L 89.640625 165.378906 L 105.019531 202.464844 Z M 119.582031 209.722656 L 117.039062 203.585938 L 97.347656 156.082031 L 94.804688 149.957031 L 162.507812 112.816406 L 187.875 178.375 L 191.882812 188.859375 Z M 206.234375 196.488281 L 204.066406 190.816406 C 204.03125 190.695312 204.054688 190.558594 204 190.441406 L 197.398438 173.371094 L 167.96875 96.359375 L 285.757812 34.210938 L 334.824219 156.902344 Z M 206.234375 196.488281 "/>
<path style=" stroke:none;fill-rule:nonzero;fill:rgb(50.980395%,50.980395%,50.980395%);fill-opacity:1;" d="M 309.5 3.355469 C 308.402344 0.609375 305.28125 -0.714844 302.554688 0.375 C 299.820312 1.476562 298.484375 4.585938 299.574219 7.320312 L 363.6875 167.632812 C 364.53125 169.726562 366.542969 171 368.65625 171 C 369.320312 171 369.992188 170.882812 370.644531 170.617188 C 373.378906 169.515625 374.714844 166.40625 373.625 163.667969 Z M 309.5 3.355469 "/>
<path style=" stroke:none;fill-rule:nonzero;fill:rgb(50.980395%,50.980395%,50.980395%);fill-opacity:1;" d="M 192.34375 224.4375 L 160.285156 224.4375 C 148.105469 224.4375 138.914062 233.628906 138.914062 245.8125 L 138.914062 259.867188 L 76.09375 333.171875 C 74.167969 335.40625 74.425781 338.78125 76.671875 340.707031 C 77.675781 341.574219 78.914062 342 80.144531 342 C 81.648438 342 83.144531 341.371094 84.191406 340.128906 L 146.714844 267.1875 L 170.972656 267.1875 L 170.972656 336.65625 C 170.972656 339.605469 173.363281 342 176.3125 342 C 179.261719 342 181.65625 339.605469 181.65625 336.65625 L 181.65625 267.1875 L 205.914062 267.1875 L 268.425781 340.128906 C 269.484375 341.371094 270.980469 342 272.484375 342 C 273.714844 342 274.953125 341.574219 275.957031 340.707031 C 278.203125 338.78125 278.460938 335.417969 276.535156 333.171875 L 213.714844 259.867188 L 213.714844 246.613281 C 213.714844 234.183594 204.332031 224.4375 192.34375 224.4375 Z M 203.027344 256.5 L 149.601562 256.5 L 149.601562 245.8125 C 149.601562 239.515625 153.992188 235.125 160.285156 235.125 L 192.34375 235.125 C 198.433594 235.125 203.027344 240.0625 203.027344 246.613281 Z M 203.027344 256.5 "/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

Before After
Before After