It is currently Fri Jul 28, 2017 7:43 am


Latest GIMP Scripts & Plug-ins

All times are UTC - 5 hours [ DST ]



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

Joined: Jan 20, 2013
Posts: 6355
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.
http://bakon.ca/gimplearn/import-export ... r-gimp-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.

_________________
Vanitas vanitatum et omnia vanitas.


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) 
Online
GimpChat Member
User avatar

Joined: Jan 06, 2017
Posts: 120
Location: UK.
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: 3614
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

Joined: Jan 20, 2013
Posts: 6355
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.

_________________
Vanitas vanitatum et omnia vanitas.


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

Joined: Mar 04, 2011
Posts: 1133
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

Joined: Jan 20, 2013
Posts: 6355
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.

_________________
Vanitas vanitatum et omnia vanitas.


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

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

_________________
Vanitas vanitatum et omnia vanitas.


Top
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Saving Paths (Solved)

2

No new posts Is there a way to make selections and saving them as paths in jpegs?

6

No new posts Attachment(s) Saving in .XCF

60

No new posts Attachment(s) Help With Saving As PDF

4

No new posts Saving as .xcf then .png?

6



* Login  



Powered by phpBB3 © phpBB Group