Jump to content
You must now use your email address to sign in [click for more info] ×

Suboptimal SVG export


Recommended Posts

SVG slices exported with the German Affinity Designer 1.9.2.1035 for Windows might contain a lot of unnecessary (=empty) groups:

  • In the attached screenshot, every smallish rectangular area contains an icon. In order to structure this amount of icons, each of them is put into a separate named layer. For each rectangular area, a slice with the same name is available, so that a large number of SVGs is created on export.
  • The created SVGs look nice, but have a comparatively large file size. Attached is one of them.
  • Looking through the SVG source, it appears that every named layer is included into the final SVG as a group, even if this group is completely empty. Excerpt (lots of empty groups before and after that):
            <g id="Meander">
            </g>
            <g id="Mark">
                <rect x="872" y="242" width="2" height="20" style="fill:rgb(160,160,160);"/>
                <rect x="870" y="258" width="20" height="2" style="fill:rgb(160,160,160);"/>
                <g transform="matrix(1,0,0,1.33333,1,-84)">
                    <rect x="881" y="249" width="2" height="6"/>
                </g>
                <g transform="matrix(1.33333,0,0,1,-293,-8.52651e-14)">
                    <rect x="879" y="251" width="6" height="2"/>
                </g>
            </g>
            <g id="Lock">
            </g>
            <g id="LbrPackage">
            </g>
            <g id="LbrOpen">
            </g>
            <g id="LbrDevice">
            </g>
            <g id="Lbr">
            </g>
  • Here, even the rectangle transformations would not be necessary, but let's just forget about those...

It would be nice if at least the empty groups would be excluded from the export. In the attached SVG, this would reduce the number of lines from 428 to 16, and the file size from 9375B to 997B.

Andreas Weidner

SuboptimalSVG.png

Mark.svg

Link to comment
Share on other sites

Unfortunately, 'Flatten Transform' does not do the trick:

  • Yes, it throws away the three or four rectangle transformations and therefore makes the resulting SVGs a little bit smaller.
  • No, it still keeps the >150 completely empty but named groups. I therefore still consider this a bug...

Thanks for the tip, though – this made me dig a bit deeper and realise that I can define my own export presets that afterwards appear in the slice options. I didn't know that before.

Andreas Weidner

Link to comment
Share on other sites

  • 2 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.