SVG to black-and-white
awk, python, sed, svg, xslt
Solution
Two options that I would try:
1- Inkscape appears to be able to do it - Inkscape Convert 2- SVG supports a ColorProfile attribute on the SVG element that can reference an ICC Color Profile. I would try to reference a GrayScale color profile there and see what happens. Looks like there is one available here.
Problem
I would like to be able to convert SVG documents to black and white. My try is the following Makefile script using 'sed' : ``` %.bw.svg: %.svg sed '/stroke:none/!s/stroke:[^;\"]*/stroke:black/g' $< > $@ ``` This works for lines etc but not for fillings. Basically if the stroke is not invisible (none), then I convert it to black. I would like to do the same for fillings, if not white or invisible, then convert to black. I wonder if it would be too complex to do something like this in a better way, perhaps using XSLT, but I have no experience. Anyone can help ?