How to use /usr/share/inkscape/gradients ?

Post questions on how to use or achieve an effect in Inkscape.
Pander
Posts: 19
Joined: Tue Sep 08, 2009 7:46 pm

How to use /usr/share/inkscape/gradients ?

Postby Pander » Sat Sep 15, 2012 10:12 pm

How can I use /usr/share/inkscape/gradients ? There are no gradients files at the moment. Are they the same format as GIMP's gradients? How do I use them in Inkscape?

generatemutate
Posts: 39
Joined: Thu Aug 23, 2012 5:48 am

Re: How to use /usr/share/inkscape/gradients ?

Postby generatemutate » Sun Sep 16, 2012 1:09 am

looks like inkscape stores the gradients in the SVG file. to transfer between inkscape and gimp-

To import Inkscape gradient into Gimp, just place the SVG file containing the gradient into the gimp gradients folder and refresh the Gradient dialog. The gradients will be imported and you can see them in the gradients dialog.

To import Gimp gradient into Inkscape, you just need to drag and drop the gradients into Inkscape.Now you can just go on filling objects with gradient.
[Inkscape will throw an error while importing some .ggr files (files with CRLF end-of-file). What you can do to import is save it in unix format using a text editor like notepad++. and then import].

http://art.vinayraikar.com/2008/02/playing-with-gradient.html

Pander
Posts: 19
Joined: Tue Sep 08, 2009 7:46 pm

Re: How to use /usr/share/inkscape/gradients ?

Postby Pander » Mon Sep 17, 2012 6:06 pm

Copying a .ggr file to /usr/share/inkscape/gradients does not offer that gradient in Inkscape. Dragging and dropping a gradient from GIMP to Inkscape has no effect either. Also no errors are reported. Can you give me please preciese instrcutions how to do this with some screenshots? Mostly, I am interested in adding .gg files to /usr/share/inkscape/gradients. Where exactly should these gradients be offered in Inkscape?

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: How to use /usr/share/inkscape/gradients ?

Postby ~suv » Mon Sep 17, 2012 7:25 pm

Pander wrote:Mostly, I am interested in adding .gg files to /usr/share/inkscape/gradients.
This directory is currently not used by Inkscape (Inkscape does not maintain a library of gradients stored outside the current document). AFAICT this directory is a remnant from an earlier reorganisation of the shared resources directory structure (and like the unused 'fonts' directory more an indication of an earlier version of the roadmap for future development than actually a representation of implemented features).

You can import GGR files via the regular 'File > Import…' file chooser dialog: there exists a file type entry for "GIMP Gradient (*.ggr)" in the popup menu below the file listing which is based on an internal plugin.
  • The source code for this internal plugin is here: gimpgrad.h, gimpgrad.cpp (stable release branch).
  • After having imported a GIMP gradient file, you can then choose the imported gradient in the current document the same way you can choose any of the existing gradients created in Inkscape itself (via gradient tool controls bar, or in 'Fill&Stroke').

Pander
Posts: 19
Joined: Tue Sep 08, 2009 7:46 pm

Re: How to use /usr/share/inkscape/gradients ?

Postby Pander » Mon Sep 17, 2012 7:48 pm

OK, thanks, that works.

Would it be OK to create a feature request that .ggr files in ~/.config/inkscape/gradients/ and /usr/share/inkscape/gradients/ are always available in the linear and radial gradient fill selection without them being imported into the current SVG until the get selected? Also, upon saving, the unused gradients should be purged from the SVG when identical gradients exist in the aforementioned directories in order to do some garbage collection.

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: How to use /usr/share/inkscape/gradients ?

Postby ~suv » Mon Sep 17, 2012 8:53 pm

Pander wrote:Would it be OK to create a feature request that .ggr files in ~/.config/inkscape/gradients/ and /usr/share/inkscape/gradients/ are always available in the linear and radial gradient fill selection without them being imported into the current SVG until the get selected?

Filing yet another series of feature requests which are already in the tracker (maybe with slight variations) won't really be helpful at the moment (IMVHO) - time could be spent instead working e.g. on mockups for a more detailed blueprint, or on details about proposed user interfaces and implementation. AFAIU there are also likely missing SVG features which currently are not supported by Inkscape and would have to be implemented first (e.g. load paint servers like gradients and patterns from external files, to be able to support loading to and from external resource files (instead of copying the gradient definition into the current document)).

Related reports (I only did a quick search, there are probably plenty of others around, since this is hardly a new feature no one has been thinking about in all those years inkscape has been around): Note that the 'Auto'-palette for custom swatches can also hold gradients (just a hint that palettes possibly could be used in future versions to load/share preset collections of gradients). More about swatches can be found e.g. on this Wiki page: Swatch Book (Inkscape Wiki).

Pander wrote:Also, upon saving, the unused gradients should be purged from the SVG when identical gradients exist in the aforementioned directories in order to do some garbage collection.
Trouble with such a concept is for example sharing or publishing SVG files while not risking to loose data (custom gradients stored for the current user, but not on any other system will result in data loss (missing gradients) when sharing the file, or when publishing on the web without extra precautions).

Pander
Posts: 19
Joined: Tue Sep 08, 2009 7:46 pm

Re: How to use /usr/share/inkscape/gradients ?

Postby Pander » Mon Sep 17, 2012 9:04 pm

OK, thanks. I will add my ideas to the appropriate existing bug reports. Also improve my last remark with something like "when the unused gradients were not available in the SVG upon opening it" For me, this thread can be closed.

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: How to use /usr/share/inkscape/gradients ?

Postby ~suv » Mon Sep 17, 2012 9:12 pm

There is for example an existing blueprint (Gradient Presets) without any additional details: maybe you could contact the author and work on a more detailed specification (which could be hosted in the Inkscape Wiki and linked to the blueprint, like for example done for this blueprint: UI - Gradient Window).

(blueprints related to gradient (search result))


Return to “Help with using Inkscape”