scour-project / scour

Scour - An SVG Optimizer / Cleaner
Apache License 2.0
757 stars 61 forks source link

Optimization: De-duplicate features with the <use> element #301

Open MayeulC opened 1 year ago

MayeulC commented 1 year ago

That would be especially meaningful if the same base64-encoded image appears multiple times.

It can also be helpful for other shapes, but it changes how the svg behaves when modified, so it's probably better to disable the optimization by default.

I haven't looked at the code, but I imagine a hash can be constructed from the data of each element, and double-checked when there is a potential match.