GNOME Bugzilla – Bug 761060
Add a "Flood" select action
Last modified: 2016-03-08 14:41:22 UTC
Created attachment 319621 [details] Flood demonstration When trying to select a tricky area with one of the region select tools, it's not uncommon for the selection to contain many small "bubbles", as shown in the attached screenshot. The following patch set adds a "flood" select action, which helps getting rid of those. Conceptually, think of the selection mask as a height map of a hilly terrain, and imagine this terrain being completely flooded during a storm. Once the storm has abated, the remaining water form lakes in the terrain's depressions. The flood action assigns to each pixel in the selection mask the elevation of (the ground or water level at) that pixel after the flood, hence the name. To put it in more precise terms, at each pixel, take all the paths from that pixel to the outside, and find the maximum value of the selection mask along each of these paths. The result of the operation at the said pixel is the minimum of these maxima.
Created attachment 319625 [details] [review] 0001-app-Add-gimp-flood-GEGL-operation.patch
Created attachment 319626 [details] [review] 0002-app-Add-gimp_channel_flood-function.patch
Created attachment 319627 [details] [review] 0003-app-Add-Flood-select-action.patch
Created attachment 319628 [details] [review] 0004-pdb-Add-gimp-selection-flood.patch
The interesting stuff are in patch 1, the rest is boilerplate.
That looks extremely useful. I think we want this. About the patches, I didn't find anything wrong.
Wow that looks cool! The case shown by the screenshot happens to me so many times! :-)
Pushed to master: commit b52da8a17e2eb01cee3399b6b0e4b660a22f807d Author: Ell <ell_se@yahoo.com> Date: Sun Jan 24 18:24:51 2016 +0000 pdb: Add gimp-selection-flood commit 71119d41c0e6df99094d8b15907283450007918b Author: Ell <ell_se@yahoo.com> Date: Sun Jan 24 17:43:35 2016 +0000 app: Add "Flood" select action and associated UI entries. This action applies the "gimp:flood" operation to the selection. commit 3f04e349cf7be63b78a261652101bfbc8eea1540 Author: Ell <ell_se@yahoo.com> Date: Sun Jan 24 17:38:31 2016 +0000 app: Add gimp_channel_flood() function This function applies the "gimp:flood" operation to the channel. commit c63bee344057343eb5edac23ef996400e23bcafc Author: Ell <ell_se@yahoo.com> Date: Sun Jan 24 17:08:43 2016 +0000 app: Add "gimp:flood" GEGL operation This operation assigns to each pixel the minimum of the maxima of all paths from it to the outside, as if the input image represents a height map, and the operation floods it with water.
*** Bug 763226 has been marked as a duplicate of this bug. ***