Category:SVG simplification by avoidance

Files generated by SVG editors are often filled with large parts of dead code which can be stripped without any influence on the graphic.

For example, a file of over 208 kB generated by Inkscape contained more than 98% mere garbage. It contained useless code like the following:

  • style="opacity:0.81153845999999985; 17 decimal fractions - but fill-opacity and stroke-opacity are defined later as fill:#000000;fill-opacity:0; it is invisible! (why not 0.00000000000000000 ?)
  • stroke:#000000;stroke-width:1.70000005000000010;stroke-miterlimit:4;stroke-opacity:0.01339286; - practically invisible
  • stroke-dasharray:none;stroke-dashoffset:7.79999999999999980; an offset with 17 decimal places for an invisible none dasharray

One particularly convincing example is South Azerbaijan red flag.svg, a simple rectangle, whose initial version (generated by Inkscape) consumed a thousand times more storage space.

As another example, the first fill of the rectangle with <path fill="#C31A3E" d="m0,0h126v84H0"/> can be avoided with <circle fill="#C31A3E" r="160"/>.
The radius should be . The mentioned file had been deleted, an example for using this method is shown in F1 yellow flag with red stripes.svg.

Category:SVG simplification techniques#%20A

Pages in category "Category:SVG simplification by avoidance"

Category:Hidden categories Category:SVG simplification techniques