Selction bounding box & shrink radius - Printable Version +- Gimp-Forum.net (https://www.gimp-forum.net) +-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP) +--- Forum: Extending the GIMP (https://www.gimp-forum.net/Forum-Extending-the-GIMP) +---- Forum: Scripting questions (https://www.gimp-forum.net/Forum-Scripting-questions) +---- Thread: Selction bounding box & shrink radius (/Thread-Selction-bounding-box-shrink-radius) |
Selction bounding box & shrink radius - david - 12-14-2023 I have been trying for a couple of days to find the relationship between a selection bounding box and the radius which is used for shrink or grow selection. My first thoughts were that the radius would be half the diagonal of the bounding box, but this appears not to be true. In the Shrink/Grow/Feather LIVE PREVIEW GIMP by TinT he has used a binary search routine to find the shrink radius which reduces the selection size to zero in order to set the minimum value for the adjustment slider. However, this is very slow for large images. I thought that there must be a mathematical formula for the shrink radius that would reduce the size of the smallest bounding box side to half of it's original value. Help from our resident geniuses greatly appreciated! david. RE: Selction bounding box & shrink radius - Ofnuts - 12-15-2023 The shrink is an absolute distance in pixels between the old and new selections: [attachment=10868]
The diagonal, no, but half the smallest dimension, certainly.
RE: Selction bounding box & shrink radius - david - 12-15-2023 (12-15-2023, 12:55 PM)Ofnuts Wrote: The shrink is an absolute distance in pixels between the old and new selections: Many thanks! Problem solved. My calculator has been hot for the last two days. Shrink and Grow change the aspect ratio of the selection, so perhaps we need a relative Shrink and Grow? david. RE: Selction bounding box & shrink radius - Ofnuts - 12-15-2023 (12-15-2023, 02:32 PM)./david Wrote:(12-15-2023, 12:55 PM)Ofnuts Wrote: The shrink is an absolute distance in pixels between the old and new selections: What you want then is Scale selection (Scale tool in Scale selection mode) (scaling center determination left as an exercise to the user). |