It is currently Sat Jul 11, 2026 11:14 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 29 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: Python or Scheme script request (selection from guides)
PostPosted: Mon Sep 19, 2016 8:36 am  (#21) 
Offline
GimpChat Member

Joined: Sep 13, 2016
Posts: 137
It does not do anything yet, because I need to know WHAT you exactly wish tod do!

E.g. two (or three??) horizontal guides two (or more) vertical guides and then select all rectangles inbetween(??? or ???) and select them and what next? stroke them black? or ???

So the wish is for a mathematician totally undecided ... exact wish is needed ;)

EDIT:
Because my way lets the guide-lab live one could say: select and stroke always the first upper middel rectangle ... deleting is easy so other rectangles could become the most upper left rectangle to stroke.
But maybe you would like to stroke (with what) all only the upper ones etc

Hope it is now clear what I want to know :yes


Top
 Post subject: Re: Python or Scheme script request (selection from guides)
PostPosted: Mon Sep 19, 2016 10:26 am  (#22) 
Offline
Global Moderator
User avatar

Joined: May 16, 2010
Posts: 16100
PKHG wrote:
It does not do anything yet, because I need to know WHAT you exactly wish tod do!

E.g. two (or three??) horizontal guides two (or more) vertical guides and then select all rectangles inbetween(??? or ???) and select them and what next? stroke them black? or ???

So the wish is for a mathematician totally undecided ... exact wish is needed ;)

EDIT:
Because my way lets the guide-lab live one could say: select and stroke always the first upper middel rectangle ... deleting is easy so other rectangles could become the most upper left rectangle to stroke.
But maybe you would like to stroke (with what) all only the upper ones etc

Hope it is now clear what I want to know :yes

I got ya! Actually I want to stroke all the guides at once. Tran wrote one in scheme (script-fu) already but a Python filter would be handy also.

_________________
Image


Top
 Post subject: Re: Python or Scheme script request (selection from guides)
PostPosted: Mon Sep 19, 2016 4:01 pm  (#23) 
Online
Script Coder
User avatar

Joined: May 07, 2014
Posts: 4497
Location: Canada
Now exists in python but a little more advanced.
It composes the path out of shorter line segments that meet at intersections so that you can easily edit/delete line sections from created path.

Now in Python (Guides to path).

_________________
TinT


Top
 Post subject: Re: Python or Scheme script request (selection from guides)
PostPosted: Mon Sep 19, 2016 6:16 pm  (#24) 
Offline
GimpChat Member
User avatar

Joined: Oct 06, 2010
Posts: 4050
Tin, you are AWESOME!

LOL! Is anybody polishing up Tin's Golden Wilbur?

_________________
"In order to attain the impossible, one must attempt the absurd."
~ Miguel de Cervantes


Top
 Post subject: Re: Python or Scheme script request (selection from guides)
PostPosted: Mon Sep 19, 2016 6:20 pm  (#25) 
Online
Script Coder
User avatar

Joined: May 07, 2014
Posts: 4497
Location: Canada
mahvin wrote:
Is anybody polishing up Tin's Golden Wilbur?

:hehe

_________________
TinT


Top
 Post subject: Re: Python or Scheme script request (selection from guides)
PostPosted: Tue Sep 20, 2016 7:11 pm  (#26) 
Offline
GimpChat Member
User avatar

Joined: Dec 26, 2014
Posts: 205
Rod wrote:
I wonder if you could actually write a script that creates a selection from user placed guides?

1) User creates a grid of guides. Then runs the filter.
2) The filter creates a selection from those guides and a path from that selection. The user could then stroke the path as they see fit. Or stroke the selection. Or perhaps the filter could allow a toggle for either choice?

An interesting idea, which I couldn’t get out of my mind wondering if it could be done. I got the selection from guides working then gave up on it, as I agree with ofnuts that it’s a roundabout way of doing things. I’ve uploaded the script here for anyone curious
Attachment:
oo-guides-to-selection-mk2.scm [2.53 KiB]
Downloaded 322 times

Located at <Image>/Script-Fu/Guides to selection

It is an unfinished script with no error checking and will crash or can give odd results if the user doesn’t

Add 4 guides, must be 2 vertical and 2 horizontal (the order of placement doesn’t matter)

Run the script

Repeat x number of times

Path to selection
Stroke path

PS You may need to Re-start gimp and have only one image open before using

Attachment:
guide2path2selection.jpg
guide2path2selection.jpg [ 667.98 KiB | Viewed 3552 times ]


Top
 Post subject: Re: Python or Scheme script request (selection from guides)
PostPosted: Wed Sep 21, 2016 9:34 am  (#27) 
Offline
Global Moderator
User avatar

Joined: May 16, 2010
Posts: 16100
I created this SVG Gradient for GIMP using my Notepad ++ editor. I named it (SVG Blinds)

Image

1) install the gradient attached into your gradient folder.
Attachment:
SVG Blinds.zip [393 Bytes]
Downloaded 179 times

2) Open a new image and refresh your gradients :refresh
3) In the gradients dialog, select SVG Blinds from the list.
4) In tool options select conical (sym) for shape and NONE for repeat.
5) Drag the gradient from center of image layer to an outer corner.

_________________
Image


Top
 Post subject: Re: Python or Scheme script request (selection from guides)
PostPosted: Wed Sep 21, 2016 9:58 am  (#28) 
Offline
Global Moderator
User avatar

Joined: May 16, 2010
Posts: 16100
Steve wrote:
Rod wrote:
I wonder if you could actually write a script that creates a selection from user placed guides?

1) User creates a grid of guides. Then runs the filter.
2) The filter creates a selection from those guides and a path from that selection. The user could then stroke the path as they see fit. Or stroke the selection. Or perhaps the filter could allow a toggle for either choice?

An interesting idea, which I couldn’t get out of my mind wondering if it could be done. I got the selection from guides working then gave up on it, as I agree with ofnuts that it’s a roundabout way of doing things. I’ve uploaded the script here for anyone curious
Attachment:
oo-guides-to-selection-mk2.scm

Located at <Image>/Script-Fu/Guides to selection

It is an unfinished script with no error checking and will crash or can give odd results if the user doesn’t

Add 4 guides, must be 2 vertical and 2 horizontal (the order of placement doesn’t matter)

Run the script

Repeat x number of times

Path to selection
Stroke path

PS You may need to Re-start gimp and have only one image open before using

Attachment:
guide2path2selection.jpg


Excellent script also! :bigthup Thanks.

_________________
Image


Top
 Post subject: Re: Python or Scheme script request (selection from guides)
PostPosted: Sat Apr 26, 2025 5:09 am  (#29) 
Offline
GimpChat Member

Joined: Mar 04, 2011
Posts: 2606
Just pulled this out of my archive (for various purposes) and as well as working in Gimp 2.10 it also works without modification in Gimp 3.0

Slight difference from previous attachment, some changes by MrQ so attached again.


Attachments:
Guides-to-selection-mk2.scm [2.88 KiB]
Downloaded 46 times
Top
Post new topic Reply to topic  [ 29 posts ]  Go to page Previous  1, 2

All times are UTC - 5 hours [ DST ]



* Login  



Powered by phpBB3 © phpBB Group