I'd like to be able to derive new images from a pre-existing image from the command line. To do that, I'd turn on/off specific layers that have portions of the image and then save the resulting image to a file. However, while I can see a number of commands listed in the help to manipulate layers, I don't see any that would allow one to select a specific one and turn it on/off.
You can launch the interactive command line with inkscape --shell . The main difference to commands in the normal mode is that you need to explicitly indicate when you want to open a file, e.g. file-open:filename. svg; select:flowRootID; query-height .
(Shift+Ctrl+S): Save your drawing to a file with a new name. The Save As dialog includes a folder for Inkscape templates under the name templates. Saving a drawing with the name default.
If what you want to do can be achieved by deleting a few unwanted elements by their id (say, layer17
and layer4711
), you can do it this way:
inkscape image.svg \
--select=layer17 --verb=EditDelete \
--select=layer4711 --verb=EditDelete \
--verb=FileSave --verb=FileClose
Note that this will overwrite image.svg
with the result, so if you're scripting this, be sure to work on a copy rather than your originals.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With