I am not asking how to edit the gradients color, stops, opacity, or position on the image. I have many objects on my canvas with the same exact gradient and it seems as though every time I make a copy of an object inkscape duplicates my gradient. I have SOOOOOOOOOOOOOOOOOO many duplicates of the exact same gradient its not funny. I have not changed the color of the gradient what so ever since I created it and started making my icons that gradient.
should I just clear my icons gradient by changing it to a solid flat color, then copy it to a new image and recreate the gradients? This would suck since I have so many. I have around like 500 the last time I counted.
Is it possible to edit image gradients?
Solution
Yes. See this thread: Duplicate object with gradient: Edit 1 gradient = edit both?
There are some bugs. But also a workaround.
I had the same problem and did some investigation lower down in the thread.
There are some bugs. But also a workaround.
I had the same problem and did some investigation lower down in the thread.
-
- Posts: 2344
- Joined: Sun Apr 14, 2013 12:04 pm
- Location: Michigan, USA
Re: Is it possible to edit image gradients?
I'd probably use a text editor to change all the references to the "original" gradient. (I'm on Windoze, so I use "Textpad".)
Each object will still have their own gradient id, but all can point to the original via xlink:href...
In the above, the "linearGradient3799" is the id for the third object's gradient, but it is referencing "#linearGradient3755" (the original object's gradient settings for stop info). That xlink:href value is the item to replace.
It will require find/replace in all the defs, but might be faster than using the pallette GUI.
After revision, vacum-defs would remove unused gradients.
Each object will still have their own gradient id, but all can point to the original via xlink:href...
Code: Select all
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3755"
id="linearGradient3799"
gradientUnits="userSpaceOnUse"
x1="31.4285717"
y1="105.2193222"
x2="137.1428528"
y2="105.2193222" />
In the above, the "linearGradient3799" is the id for the third object's gradient, but it is referencing "#linearGradient3755" (the original object's gradient settings for stop info). That xlink:href value is the item to replace.
It will require find/replace in all the defs, but might be faster than using the pallette GUI.
After revision, vacum-defs would remove unused gradients.
- Attachments
-
- GradientEdit.svg
- three objects with gradient fill
- (4.32 KiB) Downloaded 167 times
Have a nice day.
I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1
The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/
I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1
The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/
-
- Posts: 8
- Joined: Thu Aug 28, 2014 7:40 pm
Re: Is it possible to edit image gradients?
Thanks this is great. Why does Inkscape do this? I mean I understand having many gradients with slight changes but if there are two gradients that are exactly the same should not Inkscape use the original gradient already in use?
-
- Posts: 2344
- Joined: Sun Apr 14, 2013 12:04 pm
- Location: Michigan, USA
Re: Is it possible to edit image gradients?
As noted in the topic linked above, users get the choice:
Ctrl-D (duplicate) of an object does indeed use the very same gradient.
Copy/paste generates a new gradient id with the same attributes, that the user can modify without disrupting the original.
The best choice depends on the user's needs.
In the example file I posted above, the first object is the original, the second is copy/paste, the third is a duplicate of the original. They all look the same, but only the first and third share the same gradient fill. The difference can be distinguished by looking in the fill/stroke panel, or in the Inkscape XML editor, or in a text/unix editor.
Ctrl-D (duplicate) of an object does indeed use the very same gradient.
Copy/paste generates a new gradient id with the same attributes, that the user can modify without disrupting the original.
The best choice depends on the user's needs.
In the example file I posted above, the first object is the original, the second is copy/paste, the third is a duplicate of the original. They all look the same, but only the first and third share the same gradient fill. The difference can be distinguished by looking in the fill/stroke panel, or in the Inkscape XML editor, or in a text/unix editor.
Have a nice day.
I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1
The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/
I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1
The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/