It is currently Tue Apr 23, 2024 4:18 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Saving / reloading paths
PostPosted: Mon May 15, 2017 11:48 pm  (#1) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14816
Location: roma, italy
GIMP Version: 2.8.20
Operating System: Windows
GIMP Experience: Basic Level

List any relevant plug-ins or scripts:
python-fu-tt-import-path



Tin has created an interesting script to import saved paths with different options concerning the size related to the new destination image used.
https://gimplearn.net/viewtopic.php?t=119
My note here is to tell -to those who could be interested in- that paths are sensible to the image dpi.
I discovered this when trying to use that script to import a path onto an image with different dpi (of which I was not aware...).
I saved a path created on a std image (I suppose at 96 dpi, I can't remember), then I tried to use Tin's script to import that path (selection) on a different image and I got a "gigantic" path/selection (you may see the posts on that referenced thread in Gimp-Learn).
This morning I discovered that the image on which I wanted to import the saved path has a 240 dpi. Copying the image and changing the dpi to 100 the problem of the "gigantic" path/selection was solved.

_________________
"Where am I ?"


Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: Saving / reloading paths
PostPosted: Tue May 16, 2017 2:06 am  (#2) 
Offline
GimpChat Member
User avatar

Joined: Jan 06, 2017
Posts: 204
Good detective work!


Top
 Post subject: Re: Saving / reloading paths
PostPosted: Tue May 16, 2017 2:08 am  (#3) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4739
Most cases are still taken in account with the "Scale imported paths to fit image" box in the Path import dialog.

_________________
Image


Top
 Post subject: Re: Saving / reloading paths
PostPosted: Tue May 16, 2017 3:02 am  (#4) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14816
Location: roma, italy
Thanks Ofnuts.
The specific options of Tin's script are considering "keeping aspect ratio", while AFAIK the standard "Scale..." adjusts the path to fit both the new width and the new height (unless there is some option also in the std "Scale" which I do not see).
Still interesting, when ratio is not a foundamental aspect.

_________________
"Where am I ?"


Top
 Post subject: Re: Saving / reloading paths
PostPosted: Tue May 16, 2017 3:10 am  (#5) 
Offline
GimpChat Member

Joined: Mar 04, 2011
Posts: 2424
I do not know much about tins plugin, does it re-write the svg file?

If you ever do any CAD work then you are used to working in 'real world' sizes and CAD dxf and SVG files are both descriptive, can be text.

You can try and make sense if you look at the exported svg file which describes the vector in real world (inches) terms, which goes against the grain when "Gimp uses pixels" is fired at new users.

This one a 400x400 pix 4" x 4" @ 100 ppi with the path exported as an svg. http://i.imgur.com/yB9Bz6M.jpg

Import the same path into a new image 400x400 pix 2"x 2" @ 200 ppi and the svg still honours the 4" x 4" size. http://i.imgur.com/Us844A8.jpg

Edit the svg to the new canvas size and the path returns to what is expected. http://i.imgur.com/E1LJj0n.jpg

Gimp to the rescue.
You can drag and drop a path, from the path dialogue from one open image to another open image (same procedure as a layer). Gimp will scale accordingly.

_________________
Image


Top
 Post subject: Re: Saving / reloading paths
PostPosted: Tue May 16, 2017 4:36 am  (#6) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14816
Location: roma, italy
Rich, what Tin does is analyze the width and heigth of the saved path and compare them with the image width and height, allowing the user to apply one of these options:
---------------------------------------------------------------------------------------------------------

RELATIVE_METHOD = 0           #use percentages relative based on image width and height
ABSOLUTE_METHOD = 1          #use absolute pixel positions
KEEP_ASPECT_WIDTH_METHOD = 2 #use percentages relative based on width of image but keep aspect ratio
KEEP_ASPECT_HEIGHT_METHOD = 3 #use percentages relative based on height of image but keep aspect ratio

Unfortunately - at least until now - the procedure doesn't take into consideration the different dpi used when exporting the path (created on a specific image) and when importing it to be applied on a new specific image.
This is what I wanted to tell to other people who could be interested in.

_________________
"Where am I ?"


Last edited by dinasset on Tue May 16, 2017 11:24 am, edited 1 time in total.

Top
 Post subject: Re: Saving / reloading paths
PostPosted: Tue May 16, 2017 11:23 am  (#7) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14816
Location: roma, italy
IMPORTANT !
Tin has improved his script to take care of the dpi.

_________________
"Where am I ?"


Top
 Post subject: Re: Saving / reloading paths
PostPosted: Sun Aug 27, 2017 3:24 pm  (#8) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3975
Location: Canada
just an updated link since forum has been moved
Import (exported) SVG Path with load methods Script for GIMP

_________________
TinT


Top
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Find and fill paths if closed, convert closed paths to transparent

1

No new posts palette not saving

0

No new posts Bimp - Not saving Jpegs

2

No new posts default setting for compressed saving xcf

0

No new posts Attachment(s) Script for selecting, cropping the selection and saving the file

8



* Login  



Powered by phpBB3 © phpBB Group