04-14-2023, 09:33 AM
Hello,
First time here
Anyway, I thought it would be useful if I could tell GIMP to use current selection as area for setting guides.
There is an option called New guide from selection (Images -> Guides -> New guide from selection), but this just
puts 2 horizontal and 2 vertical guides along sides of selection.
What I had in mind was to use current rectangular selection (or bounding box of it) and then "divide" it into equal parts by
setting guides (number settable by user), either horizontally, vertically, or both.
So for example, let's say I have some kind of object on my canvas, and it's already placed on the right spot.
And maybe I want to do some work on the middle third.
I could use measure tool, but this won't work without calculator.
Another option would be using rectangular selection and then setting Rule of thirds under tool options.
But choosing any tool after that results in "guides" vanishing inside of the selection, so you have to put guides
manually right after making that selection, if you don't want to loose them.
Also, if you need any number of divisions that's not already predefined (center, thirds, fifths...) this technique will not really work.
It can be done, but it will definitely take lots of repetitive steps.
So I wrote a small plugin that does exactly what I had in mind.
It's not finished yet, but it works.
So how do you use it? After placing it in plugin directory, it registers itself under
Image -> Guides -> Divide selection using guides
First you make a selection. It doesn't have to be rectangular, and if it's not it will use the bounding box of the selection
for calculation. After making a selection, choose Divide selection using guides (under Image -> Guides).
Enter the number of divisions you need, and that's it.
Now, maybe I'm re-discovering here something that's common knowledge among gimpers,
but even if that's the case, this was a good learning experience. The only problem is I'm
getting lots of GEGL related errors (GIMP 2.10.32), but from what I could read here, it's not my plugin's fault.
First time here
Anyway, I thought it would be useful if I could tell GIMP to use current selection as area for setting guides.
There is an option called New guide from selection (Images -> Guides -> New guide from selection), but this just
puts 2 horizontal and 2 vertical guides along sides of selection.
What I had in mind was to use current rectangular selection (or bounding box of it) and then "divide" it into equal parts by
setting guides (number settable by user), either horizontally, vertically, or both.
So for example, let's say I have some kind of object on my canvas, and it's already placed on the right spot.
And maybe I want to do some work on the middle third.
I could use measure tool, but this won't work without calculator.
Another option would be using rectangular selection and then setting Rule of thirds under tool options.
But choosing any tool after that results in "guides" vanishing inside of the selection, so you have to put guides
manually right after making that selection, if you don't want to loose them.
Also, if you need any number of divisions that's not already predefined (center, thirds, fifths...) this technique will not really work.
It can be done, but it will definitely take lots of repetitive steps.
So I wrote a small plugin that does exactly what I had in mind.
It's not finished yet, but it works.
So how do you use it? After placing it in plugin directory, it registers itself under
Image -> Guides -> Divide selection using guides
First you make a selection. It doesn't have to be rectangular, and if it's not it will use the bounding box of the selection
for calculation. After making a selection, choose Divide selection using guides (under Image -> Guides).
Enter the number of divisions you need, and that's it.
Now, maybe I'm re-discovering here something that's common knowledge among gimpers,
but even if that's the case, this was a good learning experience. The only problem is I'm
getting lots of GEGL related errors (GIMP 2.10.32), but from what I could read here, it's not my plugin's fault.