08-22-2017, 04:54 PM
What is mask_bounds if the selection contains inner holes?
Such as in:
Or is there some other way to get the bounds?
Such as in:
Or is there some other way to get the bounds?
What is mask_bounds if the selection contains inner holes?
|
08-22-2017, 04:54 PM
What is mask_bounds if the selection contains inner holes?
Such as in: Or is there some other way to get the bounds?
08-22-2017, 05:16 PM
Code: non_empty, x1, y1, x2, y2 = pdb.gimp_selection_bounds(image) AFAIK this returns the smallest rectangle that contains all selected pixels. So that would be your outer rectangle.
So I can't get the inner bounds from anywhere, even though they're visible?
08-22-2017, 07:20 PM
You can:
Code: pdb.plug_in_sel2path(image,None) This creates a vector/path with one stroke per rectangle. Each stroke appears to be 4 "triplets" (24 coordinates: 4 corners times 3 points(*) times 2 coordinates). The difficulty may be to figure out the inner ones from the outer ones (ie, which are "holes"). But if you have only one outer one, the rest being holes, this isn't too hard. See here for an introductions to paths if needed. See there for a bunch of scripts that deal with path, in particular the "pathSummary" function in ofn-path-edits. (*) since lines from the corners are straight lines, the "tangent handles" have the same coordinates as the anchors. See here for an introductions to paths if needed. See there for a bunch of scripts that deal with path, in particular the "summary" function in ofn-path-edits. |
« Next Oldest | Next Newest »
|