It is currently 18 Jan 2018, 01:36

GIMP Python Fu ScriptsImport (exported) SVG Path with load methods Script for GIMP (Showcase | Slideshow)

Share your Python Fu scripts for GIMP here
User avatar
tim

Administrator
View: Showcase | Slideshow
Topic Posts: 8/21
Posts: 2058
Joined: 25 Sep 2016, 17:16
Cash on hand: 6,937.46 GLP
Bank: 42,250.25 GLP
Gender: Guy
Location: Victoria, BC
Website: https://gimplearn.net
Operating System: Windows
GIMP Version: 2.8.22
My Personal Blog
My FineArtAmerica
x 1092
x 236
Contact:
Canada

Import (exported) SVG Path with load methods Script for GIMP

Post#1 by tim » 13 Oct 2016, 16:29


Gives users relative load methods when importing path from (exported) .svg path.
:download:
Import_SVG_path_2.zip #
zipped .py file (unzip and put in your GIMP's plug-ins folder)
(1.6 KiB) Downloaded 95 times

:download:
Import_SVG_path.zip #
version 2: changes dots per inch apply, then change back dots per inch
(1.63 KiB) Downloaded 16 times
:download:
Import_SVG_path (3).zip #
version 3: read width and height in inches from SVG to use original dpi that was saved.
(1.77 KiB) Downloaded 13 times

:download:
Import_SVG_path (4).zip #
version 4: scale using dpi info as well so that Relative modes would work properly
(1.83 KiB) Downloaded 31 times
Menu location (right click a path, you must have at least one path present[even if it's empty path])
Import_SVG_Path_with_load_methods_01_menu_location.png
menu location
Import_SVG_Path_with_load_methods_01_menu_location.png # (38.61 KiB) Viewed 1159 times (Watermarked | Thumbnail)
Script options (choose an exported .svg path file, choose load method):
Import_SVG_Path_with_load_methods_02_script_options.png
script options
Import_SVG_Path_with_load_methods_02_script_options.png # (18.84 KiB) Viewed 1159 times (Watermarked | Thumbnail)
--------------------------------------- Explaination of load methods ------------------------------
ABSOLUTE (pixels) Load Method is just absolute mode, it loads the path as it was saved no rescalling.
For other modes (RELATIVE modes):
We'll use an example path or an original path that was exported from a 1000x1000 image.
load_path_original_1000x1000.png
load_path_original_1000x1000.png # (14.53 KiB) Viewed 290 times (Watermarked | Thumbnail)
Now if we export the above path...

And load using RELATIVE (percentage) on a 600x400 It'll scale width and height to fit the 600x400 and we get this path, an ellipse.
load_path_600x400_relative.png
load_path_600x400_relative.png # (13.97 KiB) Viewed 290 times (Watermarked | Thumbnail)
If we load using RELATIVE WIDTH KEEP ASPECT RATIO. We'll get a circle (because of kept aspect ratio, but it'll only scale based on WIDTH to fit HORIZONTALLY)
load_path_600x400_relative_width.png
load_path_600x400_relative_width.png # (9.68 KiB) Viewed 290 times (Watermarked | Thumbnail)
If we load using RELATIVE HEIGHT KEEP ASPECT RATIO. We'll get a circle (bacause of kept aspect ratio, but i'll only scale based on HEIGHT to fit VERTICALLY)
load_path_600x400_relative_height.png
load_path_600x400_relative_height.png # (5.73 KiB) Viewed 290 times (Watermarked | Thumbnail)
0 x



aka Tin
Image gimplearn.net                                              

Registered members enjoy ads-free content
User avatar
Pat625
Script Tester
View: Showcase | Slideshow
Topic Posts: 1/21
Posts: 2031
Joined: 27 Sep 2016, 20:35
Cash on hand: 11,891.58 GLP
Gender: Gal
Location: USA
Operating System: Windows
GIMP Version: 2.8.22
x 7
x 426
United States of America

Post#2 by Pat625 » 14 May 2017, 20:40


Thank you Tin. I downloaded the script.
0 x




User avatar
dinasset
Script Coder
View: Showcase | Slideshow
Topic Posts: 12/21
Posts: 711
Joined: 20 Jan 2017, 03:50
Cash on hand: 3,469.88 GLP
Gender: Guy
Location: Roma (Italy)
x 91
x 126
Italy

Post#3 by dinasset » 14 May 2017, 21:06


Tim, just downloaded and tried.
Withsoever method it imports a "gigantic" path (with respect to the image on which the import is called).
Any suggestion/example?

edit: found the trick: the user MUST first create a line path covering the diagonal of the image.

edit2: non true, it happened only once, now again gigantic, so I wait your instructions
0 x




User avatar
dinasset
Script Coder
View: Showcase | Slideshow
Topic Posts: 12/21
Posts: 711
Joined: 20 Jan 2017, 03:50
Cash on hand: 3,469.88 GLP
Gender: Guy
Location: Roma (Italy)
x 91
x 126
Italy

Post#4 by dinasset » 14 May 2017, 22:10


Tim,
I guess you have to make experiments with (real) images, because to me it happens that if I create an empty image (white-fill) in some way I can load the saved path (then I have to add on it a layer with my real image and adjust), but if I try to load the path directly on an opened existing (real) image I never succeed, I get either a gigantic (first trials) or a minimal size (now?!), anyhow never relative to the image size, no matter I switch among the options.
Could you double-check? Thanks a lot. The functionality is really interesting.
0 x




User avatar
dinasset
Script Coder
View: Showcase | Slideshow
Topic Posts: 12/21
Posts: 711
Joined: 20 Jan 2017, 03:50
Cash on hand: 3,469.88 GLP
Gender: Guy
Location: Roma (Italy)
x 91
x 126
Italy

Post#5 by dinasset » 14 May 2017, 22:14


PS: I should inform you that I have installed the new Gimp release 2.8.22.
Maybe this is the cause (?).
0 x




User avatar
dinasset
Script Coder
View: Showcase | Slideshow
Topic Posts: 12/21
Posts: 711
Joined: 20 Jan 2017, 03:50
Cash on hand: 3,469.88 GLP
Gender: Guy
Location: Roma (Italy)
x 91
x 126
Italy

Post#6 by dinasset » 14 May 2017, 23:31


reinstalled 2.8.20.
It happens the same to me (gigantic!)
0 x




User avatar
tim

Administrator
View: Showcase | Slideshow
Topic Posts: 8/21
Posts: 2058
Joined: 25 Sep 2016, 17:16
Cash on hand: 6,937.46 GLP
Bank: 42,250.25 GLP
Gender: Guy
Location: Victoria, BC
Website: https://gimplearn.net
Operating System: Windows
GIMP Version: 2.8.22
My Personal Blog
My FineArtAmerica
x 1092
x 236
Contact:
Canada

Post#7 by tim » 15 May 2017, 09:51


please see bottom of post #1 for explanation of the RELATIVE Modes.
0 x



aka Tin
Image gimplearn.net                                              

Post Reply

Last 20 Members Who Visited This Topic

User avatar Conbagui (1), User avatar PhotoMaster (3), User avatar gnerd (2), User avatar Pat625 (1), User avatar tim (2)

  • Similar Topics
    Replies
    Views
    Last post
• Featuring Members' Works (Image Attachments Only) •
1: Ella
2: Conbagui
3: Pat625
4: Issabella
5: Issabella
6: oldmangrumpy
7: tim

Who is online

Users browsing this forum: No registered users and 2 guests