Preserve Layers When Opening and SVG File in Gimp

Post about projects that involve using Inkscape and GIMP.
User avatar
EarlyBlake
Posts: 302
Joined: Tue Jun 03, 2008 5:42 pm

Preserve Layers When Opening and SVG File in Gimp

Postby EarlyBlake » Wed Jul 16, 2008 5:48 pm

Is there a way to preserve your layers from an inscape svg file when you open it with gimp? I did just a vanilla open and gimp flattened the image including the hidden layers.
Last edited by EarlyBlake on Wed Jul 16, 2008 7:54 pm, edited 1 time in total.

User avatar
microUgly
Site Admin
Posts: 2985
Joined: Sat Jun 02, 2007 3:13 pm
Contact:

Re: Preserve Layers When Opening and SVG File in Gimp

Postby microUgly » Wed Jul 16, 2008 7:02 pm

No, there isn't, sorry.

SVG doesn't have "layers" so inkscape uses some trickery to give layer management that only Inkscape will understand.

SureWhyNot
Posts: 137
Joined: Mon Jun 16, 2008 11:37 pm
Location: United States

Re: Preserve Layers When Opening and SVG File in Gimp

Postby SureWhyNot » Thu Jul 17, 2008 1:05 am

So fight back with your own trickery!! :o Save each layer as a separate SVG and import them into the same Gimp document. You may have to use additional trickery to get the layers to center up right. :?

_Inkscaper

Re: Preserve Layers When Opening and SVG File in Gimp

Postby _Inkscaper » Tue Jul 22, 2008 10:20 pm

The easiest way is to export file from SVG to XCF using Inkscape, just click "File -> Save as -> Gimp XCF maintaing layers", and then open XCF file in Gimp. You'll have all your layers preserved, sometimes you'll just need to reorder them. This is way faster than SureWhyNot's solution. But do you really need to edit the whole picture in Gimp? There is "Edit externally" option in Inkscape from SVN which would suit much better if you want to make just small changes in your picture.

User avatar
microUgly
Site Admin
Posts: 2985
Joined: Sat Jun 02, 2007 3:13 pm
Contact:

Re: Preserve Layers When Opening and SVG File in Gimp

Postby microUgly » Wed Jul 23, 2008 8:58 am

_Inkscaper wrote:The easiest way is to export file from SVG to XCF using Inkscape, just click "File -> Save as -> Gimp XCF maintaing layers"

Great tip, thankyou. I totally forgot about being able to save as XCF.

User avatar
EarlyBlake
Posts: 302
Joined: Tue Jun 03, 2008 5:42 pm

Re: Preserve Layers When Opening and SVG File in Gimp

Postby EarlyBlake » Thu Jul 24, 2008 4:56 pm

_Inkscaper wrote:The easiest way is to export file from SVG to XCF using Inkscape, just click "File -> Save as -> Gimp XCF maintaing layers", and then open XCF file in Gimp. You'll have all your layers preserved, sometimes you'll just need to reorder them. This is way faster than SureWhyNot's solution. But do you really need to edit the whole picture in Gimp? There is "Edit externally" option in Inkscape from SVN which would suit much better if you want to make just small changes in your picture.


I don't see that option :cry:
Image

I need almost all the layers because:

I want to use some of the layers as mask and paths for air brushing some areas. And I'm going to put on some of blurs in gimp, because blur slows down gimp too much in Vista. And I want to use motion blur but only one some layers (I don't see a motion blur in inkscape). Also I want to do multiple Gaussian blurs on one layer for an effect don't think you can get in inkscape right now. Other than that nothing.


Edit:
I did a save in inkscape by just typing in .xcf as the file extension. Then open in gimp. Gimp asked me if I wanted to preserve paths and it did bring in the paths.

Edit 2
OK, gimp dropped a few small paths when translated the file, and a few things are not scaled correctly. Also the resulting alpha on areas covered by a multiple stop gradient isn't right. And I can't get the air brush to follow the paths for some reason. It will pant the path with a regular brush but not the air brush. Grrrr, it looks like a gimp bug. Stoke path is not working with airbrush or fuzzy brush.

Guest

Re: Preserve Layers When Opening and SVG File in Gimp

Postby Guest » Fri May 14, 2010 4:46 pm

Any ideas why the "save as xcf" option in Inkscape doesn't work for me?
When I try and save, Inkscape returns this message: "Inkscape has received additional data from the script executed. The script did not return an error, but this may indicate the results will not be as expected."

(And there is a box below with the following:
No matching node for expression: sodipodi:namedview/inkscape:grid[@type='xygrid' and (not(@units) or @units='px')]
/usr/share/inkscape/extensions/gimp_xcf.py:98: DeprecationWarning: os.popen3 is deprecated. Use the subprocess module.
_,f,err = os.popen3(command,'r')
Traceback (most recent call last):
File "/usr/share/inkscape/extensions/gimp_xcf.py", line 173, in <module>
e.affect()
File "/usr/share/inkscape/extensions/inkex.py", line 207, in affect
self.effect()
File "/usr/share/inkscape/extensions/gimp_xcf.py", line 167, in effect
x = open(xcf, 'r')
IOError: [Errno 2] No such file or directory: '/tmp/tmp3jdoi7/New documen.xcf')

And then when I want to open the file in Gimp, I get this error message: "Opening '/home2/anna/scrap/myworking/icecream/drawing1.xcf' failed:
GIMP XCF image plug-In could not open image"


Return to “Inkscape & GIMP”