Take the 2-minute tour ×
Graphic Design Stack Exchange is a question and answer site for Graphic Design professionals, students, and enthusiasts. It's 100% free, no registration required.

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
share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

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.

share|improve this answer
    
Yes, this works flawlessly on svg files, but gives prompts on pdf files, and I have to do dozens of files this way. As well, the windows open which is annoying. –  tohecz Sep 22 '12 at 12:43
    
Unfortunately Inkscape doesn't have any terminal commands besides basic conversion of files between svg and png. Aside from writing a script in Python - which I have no experience of doing - Verbs are the only way to do this. To see a list of command-line options run "man Inkscape". –  user5182 Sep 22 '12 at 13:00
    
Regarding pdfs, Inkscape natively only uses SVG, so to avoid having the window pop up you'll have to convert the pdfs to svgs. I've updated the answer to include instructions on this –  user5182 Sep 22 '12 at 13:01
    
I found that inkscape is not a good option, whatever you do, it modifies the dimensions of the images slightly, which is a 100% no-no for me. Thanks for the answer anyways! –  tohecz Oct 24 '12 at 17:52
    
Oh no, that's a shame! You should submit a bug report about it –  user5182 Oct 27 '12 at 22:48
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.