Gimp-Forum.net

Full Version: Problem with Path selection
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, I have a problem with Path selection alignment in Gimp 2.8. In a 1920 x 1080 file (with 72.00 x 72.00 resolution), I would create a square selection with the dimensions of 500 x 500 px. Out of that selection I would create a Path using 'To Path' option:

[attachment=4545]

Up until this point everything is OK. However, I would then export the path using 'Export Path...' in 'Paths' tab. For further editing, I open the exported path in Inkscape:

[attachment=4548]
[attachment=4549]

Perhaps I import it wrong, but I never get the correct pixel dimensions like in Gimp (no matter what DPI value is set). For instance 500 x 500 from Gimp, would always be 668 x 668 pixels in Inkscape. Although, you can resize it to correct dimensions. Now, if I want to save the file (whether as 'Inkscape SVG (*.svg)' or 'Plain SVG (*.svg)'), certain issues arise if I want to use it again in Gimp.

When I import it (using 'Import Path...' in 'Paths' tab), 'Move Tool' selection box and the 'Path to Selection' option are completely out of sync:

[attachment=4550]

It is also impossible for me to align it to the grid:

[attachment=4551]

This is not the case only with Inkscape, for the same thing happens if i would rotate or scale the Path in Gimp itself (occasionally). I really don't understand what's going on or how to align it properly. Has anyone encounter this problem and knows what the issue is? Any help or insight would be much appreciated.

Thanx.
I think you should change the Gimp ppi to 96 in Image -> Print Size before exporting the svg path

That dialogue is Inkscape 1.0, just keep the defaults

Too many screenshots to post here so using imgur, those two: https://i.imgur.com/huzrRS2.jpg

That shows 501 x 501 pix - some rounding error ?

Adding a detail to the square and saving: https://i.imgur.com/CW2KNzD.jpg

It is a match here. If you need 72 ppi change it back. https://i.imgur.com/ZE9kyKe.jpg

The svg file does use the ppi for a width / height parameter. Seems to be similar to the old Inkscape/Coreldraw 90 / 96 ppi issue.
(06-18-2020, 10:06 AM)rich2005 Wrote: [ -> ]I think you should change the Gimp ppi to 96 in Image -> Print Size before exporting the svg path

That dialogue is Inkscape 1.0, just keep the defaults

Too many screenshots to post here so using imgur, those two:  https://i.imgur.com/huzrRS2.jpg

That shows 501 x 501 pix - some rounding error ?

Adding a detail to the square and saving:  https://i.imgur.com/CW2KNzD.jpg

It is a match here. If you need 72 ppi change it back.  https://i.imgur.com/ZE9kyKe.jpg

The svg file does use the ppi for a width / height parameter. Seems to be similar to the old Inkscape/Coreldraw 90 / 96 ppi issue.

Thanx for the ppi advice. I'm new with using Inkscape, so I need to play around with it a bit more.

Also, 'Fill and Stroke' affects the overall shape as well, I think. Under 'Stroke style', if 'Width' and 'Join' are set to zero, it looks like it gives more needed results.
As far as I can tell Gimp (2.10.14) exports the correct values:


[attachment=4555]
Yields:

Code:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
              "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">

<svg xmlns="http://www.w3.org/2000/svg"
     width="1.33333in" height="1.33333in"
     viewBox="0 0 400 400">
  <path id="Selection"
        fill="none" stroke="black" stroke-width="1"
        d="M 100.00,50.00
           C 100.00,50.00 100.00,350.00 100.00,350.00
             100.00,350.00 300.00,350.00 300.00,350.00
             300.00,350.00 300.00,50.00 300.00,50.00
             300.00,50.00 100.00,50.00 100.00,50.00 Z" />
</svg>
It is an Inkscape thing, must be a bug, don't know.  There is/was an Inkscape extension (dpi switcher 90/96/90)  for the old 0.98 Inkscape because the then default 90 dpi caused problems with the more usual 96 dpi used by other graphic applications, Coreldraw in particular.

Two 500 x500 pix selection-to-path exported from Gimp 2.10.14 (with ppi marking)

(1)
<svg xmlns="http://www.w3.org/2000/svg"
     width="11.1111in" height="11.1111in"
     viewBox="0 0 800 800">
  <path id="72 ppi"

(2)
<svg xmlns="http://www.w3.org/2000/svg"
     width="8.33333in" height="8.33333in"
     viewBox="0 0 800 800">
  <path id="96 ppi"
  
Import into Inkscape, set any ppi, only the 96 ppi SVG gives the correct size and imports back into Gimp the same size. 

[attachment=4556]

Not really a Gimp issue  The Gimp svg files attached