Advertisement


Inkscape in terminal: convert to greyscale


Question

What is the command for inkscape (called from the terminal) to convert graphics to greyscale? I was not able to find in in the manual. I use the following command:

inkscape -f drawing1.pdf -A grawing2.pdf
2012/09/22
1
1
9/22/2012 9:33:00 AM

Accepted Answer

Inkscape natively works with svgs. As far as I'm aware, even if you import a pdf it converts it to svg for editing. To avoid the popup window when importing a pdf you have to convert to svg. To do this install pdftosvg and run

pdf2svg inputfile.pdf outputfile.svg

To convert to greyscale in Inkscape you have to use Inkscape Verbs. This command worked for me:

inkscape -f inputfile.svg --verb EditSelectAll --verb org.inkscape.color.desaturate.noprefs --verb FileSave --verb FileQuit

A full list of Verbs can be found by running inkscape --verb-list

Unfortunately Inkscape doesn't have any command-line options aside from basic conversion from svg to png, so Verbs, which results in the window opening, is the only way to do it.

2012/09/22
3
9/22/2012 1:05:00 PM