5 releases
0.0.4 | Oct 6, 2024 |
---|---|
0.0.3 | Oct 5, 2024 |
0.0.2 | Oct 5, 2024 |
0.0.1 | Jul 27, 2024 |
0.0.0 | Jul 21, 2024 |
#799 in Web programming
350 downloads per month
21KB
428 lines
SvgOptimizer
SVG Optimizer for Rust & WebAssembly (WASM)
Motivation
Have a SVGO Rust implementation to optimize SVG files, which also exposes a WebAssembly (WASM) interface so its functionality can be used in the browser.
Features
The following list provides an overview of the features that are planned to be implemented as well as the ones that are already implemented.
Feel free to open an issue if you want to request a feature or if you want to contribute to the project by implementing any of these features.
Behavior
- Multipass
Source Code
- Prettify
- Uglify
General
- Clean up Attribute Whitespace
- Clean IDs
- Round/Rewrite Number Lists
- Round/Rewrite Numbers
- Collapse useless groups
- Minify Colors
- Round/Rewrite Paths
- Shapes to (smaller) Paths
- Style to Attributes
- Round/Rewrite Transforms
- Merge Paths
- Move Attributes to Parent Group
- Move Group Attributes to Elements
- Prefer
viewBox
towidth
/height
- Sort Attributes
- Optimize single-path SVGs
- Tidy Enable Background
Removes
- Comments
-
<desc>
tags -
Doctype
- Editor Data
- Empty Attributes
- Empty Containers
- Empty Text
- Hidden Elements
- Metadata
- Unneeded Group Attributes
- Raster Images
-
<title>
- unknowns and defaults
- unused
defs
- unused namespaces
- useless
stroke
andfill
-
viewBox
- XML instructions
- XMLNS Attribute
-
<style>
elements
Inspiration
This project is inspired by the SVGO project available for Node.js ecosystem.
License
This project is licensed under the MIT license.
Dependencies
~3.5MB
~62K SLoC