inkscape export plugin for gimp

Post unfinished work here for feedback and advise.
v1nce
Posts: 696
Joined: Wed Jan 13, 2010 4:36 am

inkscape export plugin for gimp

Postby v1nce » Thu Aug 30, 2012 9:01 am

Hi,

Some screenshots of my WIP plugin that exports your gimp image with all the settings ! including the layers, the guides, your gradients, grid and so on.

It started as a svg export plugin but as you can specify a lot of things in an "inkscape" svg (using the inkscape/sodipodi namespace)
I tried to get as much as I can from gimp workbench.

Here are two screenshots showing the file as edited in gimp and what I get in inkscape
Image
Image

What works (at least to some extend)

layer stacking
done:
offset
mask
basic blend modes
same name in gimp and inkscape
to do:
group layers (gimp >= 2.7)
emulate svg 1.2 blend mode when possible
can't be done:
some blend modes that require division (export layer with filter applied then)

path
done :
basic
todo:
use name

text
done :
font-family
color
multi line
line spacing
to test:
rtl/ltr
computation of Y offset
to do:
italics / bold, kerning

gradient
done:
basic
name
to do:
optimization (remove unnecessary stops)
choice to export only custom gradients
can't be done:
gradient with curve (only linear)

guide:
done:
100%

grid:
done:
spacing,offset,foreground color, solid vs dotted
can't be done:
detect if grid is active !!!! (libgimp sucks)
gimp dashed grid

patterns
to do:
everything


Sorry no code to show right now. I need to fix nasty bugs, wait for 3rd party dll to upgrade, clean up code...
I expect to tweak the plugin to make it works with photoshop and illustrator (with maybe some bonuses :) )

I'll post a XCF and the svg translated soon.

v1nce
Posts: 696
Joined: Wed Jan 13, 2010 4:36 am

Re: inkscape export plugin for gimp

Postby v1nce » Thu Aug 30, 2012 9:13 am

tiny pic cut my pictures so one can't see what's most interesting

reup

Image
Image

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

Re: inkscape export plugin for gimp

Postby brynn » Thu Aug 30, 2012 12:28 pm

Awesome work!

I have a couple of questions. The tiny + are the GIMP grid (gridline intersections?), correct? When the grid is exported, it appears to show as dots in Inkscape, or is that some distortion of the image? Is it dots because you happen to use the dot grid in Inkscape, or because dots are the closest Inkscape equivalent to the GIMP crosshairs?

If the exported GIMP image uses a GIMP grid, would it be show/hidable using Inkscape View menu, when imported to Inkscape? Same question for layers? After imported to Inkscape, layers will appear in Inkscape Layers dialog, and show/hidable?

When gradients are export/imported....mmmm....well actually, I haven't used GIMP very much, and it's been while. I do know that a gradient can be saved in GIMP and not in Inkscape. But I can't remember in GIMP if all gradients are automatically saved, or if it takes an extra step to preserve them? If it takes an extra step, then I wonder if there would be an option in the extension dialog whether or not to save gradient before export?

Too bad the reverse type of plug-in isn't available. If we could export Inkscape images to GIMP preserving all the same things, it would be a way of saving gradients made in Inkscape.....sort-of.... :mrgreen:

Off topic:
It may be the forum software that's cutting off images. Even the updated images don't show in full, on my screen. I usually make a link, to the full size, if necessary to see all parts. Just a friendly thought :D

v1nce
Posts: 696
Joined: Wed Jan 13, 2010 4:36 am

Re: inkscape export plugin for gimp

Postby v1nce » Thu Aug 30, 2012 8:37 pm

brynn wrote:Awesome work!

I have a couple of questions. The tiny + are the GIMP grid (gridline intersections?), correct? When the grid is exported, it appears to show as dots in Inkscape, or is that some distortion of the image? Is it dots because you happen to use the dot grid in Inkscape, or because dots are the closest Inkscape equivalent to the GIMP crosshairs?

Gimp has some grid mode that inkscape doesn't have (crosshairs, dashed line...). So I try to use the closest available in inkscape (solid or dotted). Crosshairs fallback to dotted.

brynn wrote:If the exported GIMP image uses a GIMP grid, would it be show/hidable using Inkscape View menu, when imported to Inkscape? Same question for layers? After imported to Inkscape, layers will appear in Inkscape Layers dialog, and show/hidable?

yes, yes and yes (see inkscape screenshot you get the same layer as in gimp)

brynn wrote:When gradients are export/imported....mmmm....well actually, I haven't used GIMP very much, and it's been while. I do know that a gradient can be saved in GIMP and not in Inkscape. But I can't remember in GIMP if all gradients are automatically saved, or if it takes an extra step to preserve them? If it takes an extra step, then I wonder if there would be an option in the extension dialog whether or not to save gradient before export?


I don't think you can embed gradient in *.xcf. You got to save them one by one as *.ggr. The plugin will allow you to save all/none/custom gradients (and maybe to choose using a gradient list).

brynn wrote:Too bad the reverse type of plug-in isn't available. If we could export Inkscape images to GIMP preserving all the same things, it would be a way of saving gradients made in Inkscape.....sort-of.... :mrgreen:

I'll do a import plugin too (but later). What do you really need ? importing svg in gimp or saving gradients from inkscape ?

brynn wrote:
Off topic:
It may be the forum software that's cutting off images. Even the updated images don't show in full, on my screen. I usually make a link, to the full size, if necessary to see all parts. Just a friendly thought :D

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

Re: inkscape export plugin for gimp

Postby brynn » Fri Aug 31, 2012 11:13 am

v1nce wrote:
brynn wrote:Too bad the reverse type of plug-in isn't available. If we could export Inkscape images to GIMP preserving all the same things, it would be a way of saving gradients made in Inkscape.....sort-of.... :mrgreen:

I'll do a import plugin too (but later). What do you really need ? importing svg in gimp or saving gradients from inkscape ?


The short answer, is "saving gradients in Inkscape". The long answer:
We've had complaints, here and there/off and on, as long as I've been in this forum, that Inkscape can't save gradients. If you create a new gradient, as long as it appears in the document and hasn't been vacuumed away, it exists in that document. But you can't call it up from another document. It's been so long that I assume it's difficult thing to code, although it may be that it's simply not interesting to developers. (Note that I don't know if an official request has been made or not.) I was just thinking that if it's such a difficult thing to code, maybe there would be a way to use GIMP's ability to save a gradient.....somehow. So maybe we could export to GIMP and have GIMP save the gradient. Getting the saved gradient back into Inkscape might be another story. The plug-in you're working on now might be a way to do that, but it would be a cumbersome way to call up a gradient. So saving the gradient in Inkscape would be much better.

It's not something that I would personally use very much. But it would be nice. And while there's only been a handful of topics where it's mentioned or asked about, I think a lot more people would like to see it, than have posted about it.


Return to “Work in progress”