It is currently Mon Apr 29, 2024 1:41 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: Script to save alpha to .SVG
PostPosted: Mon Jan 13, 2014 11:43 am  (#1) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
MareroQ requested a script in this post that would save each layer's alpha channel as a path to an SVG file.

The following script adds a command to the "Filters->Misc" menu that does that (using the layer name, along with a .svg extension, as the filename):

http://chiselapp.com/user/saulgoode/rep ... 6d6991f070

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


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: Script to save alpha to .SVG
PostPosted: Mon Jan 13, 2014 1:01 pm  (#2) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 5870
I too was hoping for a alpha to svg utility, thanks

_________________
My 3D Gallery on Deviantart http://photocomix2.deviantart.com/
Main gallery http://www.flickriver.com/photos/photocomix-mandala/
Mandala and simmetry http://www.flickriver.com/photos/photocomix_mandala/

Image

Mrs Wilbress


Top
 Post subject: Re: Script to save alpha to .SVG
PostPosted: Mon Jan 13, 2014 3:15 pm  (#3) 
Online
GimpChat Member
User avatar

Joined: Jan 13, 2011
Posts: 2249
Location: Poland
Saul - Very, Very Much. :coolthup
For Windows is a small problem - regardless of the directory selection - always save files *. svg to C: \ Windows \ System32 \
I know it's asking too much - is it possible (as an option) to save all the layers to one svg file - which when opened displays a separate path (as if to create multiple separate paths of each layer and use the "Export all paths from this image") .
I can not better describe (my very bad english) - but an example of such a file in the Annex (Tennessee.zip).
This new scripts is brilliant for people who work on the paths - and gives in conjunction with the script Graechan - Font to Image Hose.scm (http://gimpchat.com/viewtopic.php?f=9&t=8763%20&) in a quick manner colossal amount of new shapes.


Attachments:
Export all paths from this image.png
Export all paths from this image.png [ 67.41 KiB | Viewed 3368 times ]
Tennessee (ttf+svg).zip [53.67 KiB]
Downloaded 135 times

_________________
Image

Slava
Ukraini!
Top
 Post subject: Re: Script to save alpha to .SVG
PostPosted: Sun Jan 19, 2014 10:40 pm  (#4) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
MareroQ wrote:
I know it's asking too much - is it possible (as an option) to save all the layers to one svg file - which when opened displays a separate path (as if to create multiple separate paths of each layer and use the "Export all paths from this image") .

http://chiselapp.com/user/saulgoode/rep ... 32adfe8aac

This also may help with avoiding the System32 directory problem, as there is now only one SVG file saved. If it does not help, or if you have other suggestions, please let me know.

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: Script to save alpha to .SVG
PostPosted: Mon Jan 20, 2014 2:20 am  (#5) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4827
Location: Bendigo Vic. Australia
Saulgoode the target-directory was left out of the save file path (causing all files to save to the bin directory)

after Changing from this

(let ((path (car (gimp-image-get-active-vectors image))))
          (gimp-vectors-export-to-file image
                                       (if (> (length (strbreakup name ".svg")) 1)
                                         name
                                         (string-append name ".svg") )
                                       path )

to this now tested OK

(let ((path (car (gimp-image-get-active-vectors image))))
          (gimp-vectors-export-to-file image
                                       (if (> (length (strbreakup name ".svg")) 1)
                                         name
                                         (string-append target-directory DIR-SEPARATOR name ".svg") )
                                       path )

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: Script to save alpha to .SVG
PostPosted: Mon Jan 20, 2014 6:39 am  (#6) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
Graechan wrote:
Saulgoode the target-directory was left out of the save file path (causing all files to save to the bin directory)

:oops: :cry :gaah

:tyspin

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: Script to save alpha to .SVG
PostPosted: Mon Jan 20, 2014 7:04 am  (#7) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
Thank you Saulgoode. :)

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: Script to save alpha to .SVG
PostPosted: Mon Jan 20, 2014 10:21 am  (#8) 
Offline
Global Moderator
User avatar

Joined: Apr 07, 2010
Posts: 14182
saulgoode wrote:
Graechan wrote:
Saulgoode the target-directory was left out of the save file path (causing all files to save to the bin directory)

:oops: :cry :gaah

:tyspin


This is so funny coming from you Saul. :mrgreen:

_________________
Image


Top
 Post subject: Re: Script to save alpha to .SVG
PostPosted: Mon Jan 20, 2014 1:53 pm  (#9) 
Online
GimpChat Member
User avatar

Joined: Jan 13, 2011
Posts: 2249
Location: Poland
THANKS SAUL !
These two script-fu are hundereds useful.
The first version - in the amendment Graechan (Thank You Very Much) - it works flawlessly.
In the second version - for Windows again a small problem - you have to select the file to be overwritten (and manually change the extension to svg)
Because the two versions are different (equally very useful) - you need to change the name - or better (if possible) connect to one script-fu ?


Attachments:
Is it possible .png
Is it possible .png [ 19.46 KiB | Viewed 3181 times ]

_________________
Image

Slava
Ukraini!
Top
 Post subject: Re: Script to save alpha to .SVG
PostPosted: Mon Jan 20, 2014 10:21 pm  (#10) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4827
Location: Bendigo Vic. Australia
MareroQ I agree it would be great to merge both features into the one script

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) Shortening mouse/keystrokes save/export script or method to implement?

41

No new posts Where did GIMP save my file, & how do I change default save location

5

No new posts Attachment(s) alpha to selection

2

No new posts Alpha to Selection Help

1

No new posts Can't Alpha to Selection

5



* Login  



Powered by phpBB3 © phpBB Group