anweid Posted April 18, 2021 Share Posted April 18, 2021 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 Mark.svg Quote Link to comment Share on other sites More sharing options...
pruus Posted April 18, 2021 Share Posted April 18, 2021 If I did delete the empty groups and save it again as SVG, the empty grouping is different again. Really strange. Mark.svg Quote Link to comment Share on other sites More sharing options...
Staff Sean P Posted April 19, 2021 Staff Share Posted April 19, 2021 Hi anweid, I believe you can use the 'Flatten Transform' option inside each slice to stop the groups from being added. anweid 1 Quote Link to comment Share on other sites More sharing options...
anweid Posted April 19, 2021 Author Share Posted April 19, 2021 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 Quote Link to comment Share on other sites More sharing options...
g2M Posted April 20, 2023 Share Posted April 20, 2023 Hey anweid! Have you found a solution to the problem? Jan Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.