I am new to inkscape and I have a file with two layers. I would like to remove on all layers all objects that are not black. Can this be done?
Thank you,
Sepoto
Removing everything that is not black?
Re: Removing everything that is not black?
Welcome to InkscapeForum!
There's not any way to do that automatically. There is a way to find and delete everything of a certain color, using the XML Editor. But I don't think it could delete everything except a certain color. I don't know, I guess it might be possible to write a script or something, but that's way beyond my understanding.
Basics - Help menu > Tutorials
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
Re: Removing everything that is not black?
This is really quite easy to do, but the first couple of times might take some practice...
1. You will find it easier if your preferences, in 'svg output' are set to 'use named colors'. (Otherwise you will have to use '000000' instead of 'black'). Very importantly, in your selecting preferences, you must have 'Select in all layers' (the first option) selected!
2. Open the find dialog. CTRL-F. Enter 'black' in the find box. Search in properties. Scope 'all'. Check the 'style' box. Check the 'all types' box.
3. click find.
4. In the edit menu choose invert selection (or press !). Now delete.
0.48.1 find dialog
dev release 11265
Note that this keeps every object that has a black fill or stroke. More complicated to distinguish between the two... but you might not need to...
1. You will find it easier if your preferences, in 'svg output' are set to 'use named colors'. (Otherwise you will have to use '000000' instead of 'black'). Very importantly, in your selecting preferences, you must have 'Select in all layers' (the first option) selected!
2. Open the find dialog. CTRL-F. Enter 'black' in the find box. Search in properties. Scope 'all'. Check the 'style' box. Check the 'all types' box.
3. click find.
4. In the edit menu choose invert selection (or press !). Now delete.
0.48.1 find dialog
dev release 11265
Note that this keeps every object that has a black fill or stroke. More complicated to distinguish between the two... but you might not need to...
Last edited by druban on Tue May 01, 2012 6:03 pm, edited 2 times in total.
Your mind is what you think it is.
Re: Removing everything that is not black?
druban wrote:This is really quite easy to do, but the first couple of times might take some practice...
4. In the edit menu choose invert selection (or press !). Now delete.
One thing to keep in mind: 'Edit > Find…' searches and finds (aka selects) objects within (potentially deeply nested) groups. Inverting such a selection with objects from various group levels and deleting the inverted selection might produce unexpected results: a workaround (e.g. when working with imported clipart or editing PDF files) would be to move the selection to a new layer (cut, change layer, paste in place) to have the content separated, and then delete (or hide) the unwanted layers.
Re: Removing everything that is not black?
Just so! In my recent working release of Inkscape the find dialog has a lovely new form, including a 'scope' option that lets you select between 'all', 'current layer' or 'selection' which would alleviate this very problem. (The old dialog had this, too, but I like the new look (see pics above) better...)
But the warning is very apt, ANY global changes made on a multilgroup/nested group complex file is quite risky. Inkscape has many safeguards against such risks, as in the preferences > selecting dialog... Doing it layer by layer seems the safest, unless you are very familiar with the structure of your file.
But the warning is very apt, ANY global changes made on a multilgroup/nested group complex file is quite risky. Inkscape has many safeguards against such risks, as in the preferences > selecting dialog... Doing it layer by layer seems the safest, unless you are very familiar with the structure of your file.
Your mind is what you think it is.
Re: Removing everything that is not black?
Hhmmm....I thought you had to use the XML Editor to do that. Interesting!
Basics - Help menu > Tutorials
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
Re: Removing everything that is not black?
nice druban.
never though of using "find" for anything really usefull, eyeopener.
never though of using "find" for anything really usefull, eyeopener.