How To Save Gradients

Post questions on how to use or achieve an effect in Inkscape.
GadgetX
Posts: 2
Joined: Tue Oct 09, 2012 7:11 am

How To Save Gradients

Postby GadgetX » Tue Oct 09, 2012 7:16 am

Hello.

Google says this is the best place to ask questions about inkscape, so here I am :)

Question: I've created a gradient. Just 2 points with specific colors I've chosen. I want to save the gradient so that I can use it on multiple objects within the image and future images. How do I save it and easily access it when I select an object?

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: How To Save Gradients

Postby brynn » Tue Oct 09, 2012 4:06 pm

Image
Welcome to InkscapeForum!

It's not possible to save gradients with Inkscape. As long as the gradient is used in the image, it will always be there to choose from, in the list of gradients. (To see the list of gradients, click one of the gradient buttons in the Fill and Stroke dialog.) Even if you delete all the objects which use the gradient, it will remain in the list. That is, unless you use Vacuum Defs. But if you need it in another document....I guess there might be a couple of ways to go. You could fill a rectangle (or any simple object) with it, then paste the object into the new document. Or just recreate the gradient in the new document. You can use info from the original gradient, to be sure it's exactly the same.

User avatar
druban
Posts: 1917
Joined: Fri Nov 20, 2009 10:48 pm

Re: How To Save Gradients

Postby druban » Tue Oct 09, 2012 6:21 pm

If it's just one or two gradients you can try this:
1) get your gradient the way you want it, applied to an easily identifiable object, say a rectangle, and then save the file. Use a nice descriptive name, like cranberry-lemonade gradient.svg. Quit inkscape and open this file with a text editor and delete the object only. It should be easy to find near the bottom of the file, e.g. <rect ...../>
Now save this modified file and put it in your user/appdata/inkscape/templates folder (if you know where that is!)
Next time you start up Inkscape go to file>open and your gradient file should be there in the list for when you need it...
Let me know if this does not work for you, and we'll see if we can fix it...

N.B. This is not an official expert or developer's answer and may be quite wrong. Just my attempt as another user to solve your problem.
Your mind is what you think it is.

User avatar
Xav
Posts: 1209
Joined: Fri May 08, 2009 1:18 am
Location: UK
Contact:

Re: How To Save Gradients

Postby Xav » Tue Oct 09, 2012 8:46 pm

If you want to build up a "library" of gradients, here's one solution:

1) Create a new file and draw an object (e.g. a rectangle) in it. Give the object the gradient you want.
2) Draw another object, and give that a different gradient. Repeat until you've got all the gradients you want.
3) Save the file. Let's call it "gradients.svg". You can come back and add more later, if you want to.
4) When you create a new file and want to use your "library" of gradients, simply drag and drop your gradients.svg file into the Inkscape window of the document you're working on. All the objects, with their gradients, will appear as a single group. Move it out of the way for now.
5) Now you can pick those gradients from the Fill and Stroke dialogue and apply them to objects in your drawing.
6) When you're done, delete the group of objects you imported.

Optionally you can use File > Vacuum Defs before you save to clear up any stray gradients that may have been left behind by this process.


Druban's method is "better", but this approach doesn't take you anywhere near the XML code which I know can scare some people off.
Co-creator of The Greys and Monsters, Inked - Inkscape drawn webcomics
Web SiteFacebookTwitter

GadgetX
Posts: 2
Joined: Tue Oct 09, 2012 7:11 am

Re: How To Save Gradients

Postby GadgetX » Tue Oct 09, 2012 10:57 pm

Great responses. Thank you very much everyone.

User avatar
Maestral
Posts: 982
Joined: Sat Aug 27, 2011 7:10 am

Re: How To Save Gradients

Postby Maestral » Tue Oct 09, 2012 11:40 pm

Small addition to the previous routines...

If you add your gradients to the swatches (one by one, in the Fill&Stroke panel) before saving the file, next time when you import .svg file with gradients, you may delete the imported objects since you`ll have gradients present in a swatch pallet (Ctrl+Shift+W).
:tool_zoom: <<< click! - but, those with a cheaper tickets should go this way >>> :!:

User avatar
flamingolady
Posts: 687
Joined: Wed Jun 10, 2009 1:40 pm

Re: How To Save Gradients

Postby flamingolady » Wed Oct 10, 2012 6:49 am

I do what XAV does, I keep a file of rectangle shaped gradients in my SVG files, and simply call it 'gradients'. Then open a new file and the gradient file, then copy/duplicate the rectangle over to my new file, it's so easy that way.

I really just wanted to add that you CAN save gradients in GIMP, I haven't done it in ages, so am not the best person to ask, it isn't hard, it's just a matter of saving it in the GIMP gradient file. I suggest you go to the main GIMP forum and ask, actually just search their forum as it's a common question.


Return to “Help with using Inkscape”