I changed the stroke colour & width, duplicated the path, edited nodes, grouped and ungrouped, moved between layers, etc. This is a completely normal drawing workflow but these manipulations expanded the style attribute, eventually leading to this:
Why does my path need a font setting? Most of the added entries are pointless, and this is a modest example. In a drawing with hundreds of objects, these expanded styles can drastically increase the svg file size.
I could clear the object styles manually in the XML Editor but this is too tedious for me. Maybe the Selectors and CSS dialog is the right place for a [Clear Styles] button, or the [Edit] menu where we already have the [Edit>Paste Style] function. Perhaps somebody out there already has an efficient workflow they can share with us.
Here are my findings. I took a bloated svg file, applied all the settings, and saved a copy. The file size fell from 428k to 287k, though some unnecessary style properties still appear. For example, a simple rectangle still retains the following properties:
To find a theoretical minimum file size, I replaced all 1117 style attributes with this:
style=""
The file size fell to 207k but it's visually useless of course. This shows that the automatic culling of unnecessary styles is more than respectable. I could probably get below this minimum if I removed all shape and text styles and instead used a few group and layer styles.
In conclusion I'm reporting good results, but further experiments are in order. More steps on the endless path to the mythical file size zero.
Manipulating objects expands the style attribute without no visual benefit
When I draw a path with the Bezier tool, the default svg style is:
I changed the stroke colour & width, duplicated the path, edited nodes, grouped and ungrouped, moved between layers, etc. This is a completely normal drawing workflow but these manipulations expanded the style attribute, eventually leading to this:
What I actually need is this:
Why does my path need a font setting? Most of the added entries are pointless, and this is a modest example. In a drawing with hundreds of objects, these expanded styles can drastically increase the svg file size.
I could clear the object styles manually in the XML Editor but this is too tedious for me. Maybe the Selectors and CSS dialog is the right place for a [Clear Styles] button, or the [Edit] menu where we already have the [Edit>Paste Style] function. Perhaps somebody out there already has an efficient workflow they can share with us.
Maybe the settings for erroneous styles?
Thanks Tyler. These settings are new to me. I'll try these and report back.
Here are my findings. I took a bloated svg file, applied all the settings, and saved a copy. The file size fell from 428k to 287k, though some unnecessary style properties still appear. For example, a simple rectangle still retains the following properties:
This could be reduced to:
To find a theoretical minimum file size, I replaced all 1117 style attributes with this:
The file size fell to 207k but it's visually useless of course. This shows that the automatic culling of unnecessary styles is more than respectable. I could probably get below this minimum if I removed all shape and text styles and instead used a few group and layer styles.
In conclusion I'm reporting good results, but further experiments are in order. More steps on the endless path to the mythical file size zero.