Posts: 1,052
Threads: 87
Joined: Aug 2018
Reputation:
83
Operating system(s):
- Windows Vista or 7, 8, 10 (64-bit)
Gimp version: 2.10
(10-08-2023, 03:56 AM)sallyanne Wrote: my gimp has guides for the rectangle and elipse select - would that help?
Hi Sally,
You made a great observation, I don't remember ever noticing this form of centralization before. Really simple and without the need for plugins!
However, in this technique, the demarcation lines signaling the center are ephemeral, fleeting, lasting only as long as the selection is active, and disappearing as soon as another tool is selected.
It is still possible to register the central points by checking, for example, the information in the Pointer window (yellow circle in the attached figures)
Another way is a plugin I have (I don't know the name of this plugin/script), which is found via the menus: Image - Guides - Center of selection, which creates guides whose intersection is the central point of the selection box.
An interesting point to note is that a path that originated from a selection made by the Ellipse Select Tool will possibly (or always, I can't say) create a false center when submitted to the "ofn-path-to-shape and is" plugin. called Shapes > On Strokes > Circle > Crosshair" - As seen in the attached image.
However, for a path originating from the ofn-path-shape plugin, the generated Crosshair (in red) correctly points to the center of this circle.
.....
Samj Portable - Gimp 2.10.28 - Win-10 /64.
Posts: 1,538
Threads: 71
Joined: May 2021
Reputation:
167
Operating system(s):
Gimp version: 2.10
Alignment tool will do it, it's all natural
Drag a guide from the ruler on the left and one from the top -> you don't care where you drop them
Now select the Alignment tool, in the tool option select "Relative to Selection" then click on the guide you want to align (2 little white square will appear one on each end of the guide) then just click to the center button and voila..
Patrice
Posts: 6,408
Threads: 279
Joined: Oct 2016
Reputation:
566
Operating system(s):
Gimp version: 3.00RC1
(10-08-2023, 11:43 AM): "Krikor Wrote: (10-08-2023, 03:56 AM)sallyanne Wrote: my gimp has guides for the rectangle and elipse select - would that help?
Hi Sally,
You made a great observation, I don't remember ever noticing this form of centralization before. Really simple and without the need for plugins!
However, in this technique, the demarcation lines signaling the center are ephemeral, fleeting, lasting only as long as the selection is active, and disappearing as soon as another tool is selected.
It is still possible to register the central points by checking, for example, the information in the Pointer window (yellow circle in the attached figures)
Another way is a plugin I have (I don't know the name of this plugin/script), which is found via the menus: Image - Guides - Center of selection, which creates guides whose intersection is the central point of the selection box.
An interesting point to note is that a path that originated from a selection made by the Ellipse Select Tool will possibly (or always, I can't say) create a false center when submitted to the "ofn-path-to-shape and is" plugin. called Shapes > On Strokes > Circle > Crosshair" - As seen in the attached image.
However, for a path originating from the ofn-path-shape plugin, the generated Crosshair (in red) correctly points to the center of this circle.
This is because the first three points of the ellipse are too close to each other to there are round-off errors (try to do the same with a compass and you will have the same problem).
If you do the same by making a stroke with sufficiently spaced anchors placed on the circle then the crosshair is accurate. As the doc says for the sibling Circumcircle function: " For best accuracy, the three points should be as much spread apart as possible.". Of course circles created by OPTS itself are made of 4 anchors so these are by design sufficiently well spaced (and the crosshair's anchors will be the same as the circle. I could improve the script by trying to find the three most distant anchors.
Posts: 1,052
Threads: 87
Joined: Aug 2018
Reputation:
83
Operating system(s):
- Windows Vista or 7, 8, 10 (64-bit)
Gimp version: 2.10
(10-08-2023, 04:03 PM)PixLab Wrote: Alignment tool will do it, it's all natural
Drag a guide from the ruler on the left and one from the top -> you don't care where you drop them
Now select the Alignment tool, in the tool option select "Relative to Selection" then click on the guide you want to align (2 little white square will appear one on each end of the guide) then just click to the center button and voila..
Patrice, with the advantage of not needing a plugin :-)
The Alignment Tool is much more versatile than it seems.
This reminds me of this post:
https://www.gimp-forum.net/Thread-Align-...t-of-1?pid= 17612#pid17612
(10-08-2023, 04:17 PM)Ofnuts Wrote: This is because the first three points of the ellipse are too close to each other to there are round-off errors (try to do the same with a compass and you will have the same problem).
If you do the same by making a stroke with sufficiently spaced anchors placed on the circle then the crosshair is accurate. As the doc says for the sibling Circumcircle function: "For best accuracy, the three points should be as much spread apart as possible.". Of course circles created by OPTS itself are made of 4 anchors so these are by design sufficiently well spaced (and the crosshair's anchors will be the same as the circle. I could improve the script by trying to find the three most distant anchors.
I have a vague memory of having problems with circles created with the Ellipse Tool in the past. That's when I started using plugins for this purpose.
An example is what happened to this circle seen in the first image. Created with the Elipse Tool and then converted to path, and then again from path to selection.
When the initial selection is still active, the XY values for selection and W/H are correct:
Selection x/y = 274 and W/H = 250
But after path to selection:
Selection:
x=274 ; y 275 / W=251 ; H=250
For the circle created directly for the path, this deviation does not occur, as seen in the second image of my previous post.
.....
Samj Portable - Gimp 2.10.28 - Win-10 /64.
Posts: 1,171
Threads: 179
Joined: Sep 2018
Reputation:
116
Operating system(s):
- Windows (Vista and later)
Gimp version: 2.10
I have already experienced that when I rotate and move a circle path in Gimp, the 'selection from path' gives a different result than 'stroke path'. Probably a rounding or interpolation of path values to pixel values that is done in a different way. This story reminds me of a problem that I had when I wrote a program to convert 2D NC programs of contours that only consisted of ISO codes G01, G02 and G03 to DXF files. They were old files of complicated contours that needed to be corrected in a CAD system. After conversion, the various entities on the CAD system were not closed. This was because the CAD-CAM conversion rounded the intersection values to 3 decimal places. After converting to DXF, those values were included. With an NC machine this does not pose a problem because you can enter a parameter in the machine after which it bridges these gaps in the contour. The CAD user then had to close all openings of the contour with the CAD program before he could correct the contour for new use.
Circle path drawing in gimp convert to 'path to selection' and 'stroke path' :
Posts: 1,052
Threads: 87
Joined: Aug 2018
Reputation:
83
Operating system(s):
- Windows Vista or 7, 8, 10 (64-bit)
Gimp version: 2.10
In this image you can see another problem when creating a circle using the Ellipse select tool --> Irregularities in its contour when painted (strokes)
Just remember that having two equal circles in paths, your strokes will have different thicknesses if they are stroked in the selection (Path to selection - Fig 01) or directly on the path (Stroke Path - Fig 02).
In case 01, only half the thickness will be stroked.
.....
Samj Portable - Gimp 2.10.28 - Win-10 /64.
Posts: 6,408
Threads: 279
Joined: Oct 2016
Reputation:
566
Operating system(s):
Gimp version: 3.00RC1
(10-10-2023, 06:45 AM)Krikor Wrote: In this image you can see another problem when creating a circle using the Ellipse select tool --> Irregularities in its contour when painted (strokes)
Just remember that having two equal circles in paths, your strokes will have different thicknesses if they are stroked in the selection (Path to selection - Fig 01) or directly on the path (Stroke Path - Fig 02).
In case 01, only half the thickness will be stroked.
You get half the thickness because you keep the selection, so the stroke is constrained to the selection. If you to Select > From path and then Select > None, the stroked path has the required width. If you think you need the selection later, then Select > Save to channel first (and make the layer active again otherwise the path will be stroked on the saved channel).
|