Tool to simplify SVGs. Converts an input svg into a "pico" svg:
<defs> element, first child of root<defs><defs>, only <g> and <path>
<g> is eliminated when possible, but may be retained for opacityClip paths and strokes are rendered into equivalent paths using Skia via skia-pathops, <use> references are materialized, etc.
Some SVG features are not supported, of particular note:
<filter><mask>Usage:
pip install -e .
picosvg mysvg.svg
Requires Python 3.10 or greater.
Install the dev dependencies specified in extras_require.
pip install -e .[dev]
pytest
If you use zsh, it will prompt an error(zsh: no matches found: .[dev]). Please use the following command:
pip install -e '.[dev]'
You can also use pytest to test the specified files individually.
pytest tests/svg_test.py
If you need to test a certain function (for example: test_topicosvg), please execute:
pytest tests/svg_test.py::test_topicosvg
If you need to display detailed diff information, please execute:
pytest tests/svg_test.py::test_topicosvg --vv
Python
99.1%
Tool to simplify SVGs. Converts an input svg into a "pico" svg:
<defs> element, first child of root<defs><defs>, only <g> and <path>
<g> is eliminated when possible, but may be retained for opacityClip paths and strokes are rendered into equivalent paths using Skia via skia-pathops, <use> references are materialized, etc.
Some SVG features are not supported, of particular note:
<filter><mask>Usage:
pip install -e .
picosvg mysvg.svg
Requires Python 3.10 or greater.
Install the dev dependencies specified in extras_require.
pip install -e .[dev]
pytest
If you use zsh, it will prompt an error(zsh: no matches found: .[dev]). Please use the following command:
pip install -e '.[dev]'
You can also use pytest to test the specified files individually.
pytest tests/svg_test.py
If you need to test a certain function (for example: test_topicosvg), please execute:
pytest tests/svg_test.py::test_topicosvg
If you need to display detailed diff information, please execute:
pytest tests/svg_test.py::test_topicosvg --vv
Python
99.1%