Open JulianBrasse opened 1 year ago
I noticed a similar problem. For example, in the screenshot is the same SVG - left before import, right after export from PenPot
Hey!, thank you very much for the feedback. The reason after all of these is that we have to support in svg thins that aren't supported directly (multiple fills, multiple strokes, different type of strokes...)
There is an enhancement in our Taiga to make our svg exports cleaner, I'm pointing this issue from there: https://tree.taiga.io/project/penpot/issue/4131
Penpot unapologetically and unconditionally supports open standards for all your design work. Our SVG and web standards approach means zero vendor lock-in and extreme interoperability.
One could argue that this is misleading as bloated svg is barely usable outside of Penpot. Following the promise in words rather than in spirit.
This is something to be fixed. I've just exported a 250kb svg from Figma, pasted it into Penpot, exported it back and it's 350kb now, full of garbage and the structure is broken & IDs are lost, which is critical for me, since we parse and manipulate the svg in our web app.
If I import and export using Sketch, the file size becomes 5kb smaller, keeping the structure and ids.
This is a show stopper for us...
@superalex It seems that nothing has happened on the taiga + I can't comment there, so I am wondering if this somehow got ignored as this really is the biggest issue I have been having with penpot, so much so that I have literally been coding the SVG files myself or using PowerPoint's slightly less messy SVG export (I am aware that inkscape exists but no), rather then Penpot's. This is why I am asking your team to rethink the importance of this and maybe consider fixing the problem.
Any updates planed on this issue?
I just evaluated Penpot (and I’m very impressed so far :-)) for the first time for an upcoming project and ran into the same issue, when creating icons for a website. A modern web design workflow often means to manage all vector assets within one application, at least that’s what I did when working with Sketch or Figma. A website often contains dozens of icons, which usually need to follow a certain structury to allow for dynamic colorization. This often requires to set fills to e.g. currentColor
manually after exporting – not a big deal when the exported SVG is clean. Unfortunately, this is currently a show-stopper for my team for adopting Penpot, because even SVGO is not able to remove all of the extra code from Penpot-exported SVGs at the moment. I hope that this issue is given a certain priority, because as long as we cannot get clean SVGs out of Penpot, its use for web design is rather limited.
Why isn't this given a top priority? Inefficient SVGs are a show stopper for use on the web!
The SVG code in exported files from Penpot is quite inefficient and use some unnecessary/deprecated attributes (xmlns:xlink="...") and also at times empty attributes (transform="") or unused ones (id="..."). The fill attribute and similar attributes are found in style attributes, which isn't recommended. Circles are always ellipses and polygon or polyline shapes are always paths. SVGs exported with text will have embedded the font, instead of converting the text to paths, which could be implemented as shown in #1342 . Additionally many unnecessary elements are used as definitions (defs element) for shadows and gradients, and many unnecessary groups are made. These are only some of the things I have encountered, but they increase the size of the svg files and make them bloated, harder to use and incompatible with some programs. Some examples:
Circle
A simple circle has many more lines of code after export from Penpot. It is the exact same image and no information or content is lost. Often even displaying the SVG file from Penpot doesn't work, most likely due to the bloat and unsupported attributes.
Efficient SVG
Current Penpot SVG
Complex Objects
The difference is much more visible with even just slightly more complex objects that have groups, shadows, text and gradients. Even in this example, where I simply added a diamond-shaped path with dropshadow and grouped everything, the difference in the Penpot version is extreme.
Efficient SVG
Current Penpot SVG