Simple script to convert svg files to grayscale.
The replacement uses a simple regex so if you have text containing SVG color codes in your SVGs, this will replace them, sorry. My first draft of this script used BeautifulSoup and avoided this issue but I decided against requiring external dependencies.
Note: the script does not currently handle named colors; that's planned for the future.
- Make sure
python3
is in yourPATH
- Put
svgray
and.svgray.py
in the same directory somewhere in yourPATH
or wherever you intend to use it chmod x svgray
svgray [-q] FILE