How about using Generate Image Assets instead? This feature is amazing but often overlooked.
Enable it from the menu File > Generate > Image Assets;
Rename layers/groups/whatnot to file names and, optionally, add size variables;
Generate will pickup those and export them instantly;
An example. My setup: 2 artboards, some groups and layers:
In Photoshop (I think this is what you are referring to)
Use Select > Color range to make a selection by colour
Do Layer > New > Layer via copy or Ctrl+J
Use the Select by Colour tool to make a selection by colour
Do Edit > Copy or Ctrl+C
Do Edit > Paste as > New Layer in Place
There's no default shortcut in GIMP for the last ...
Very likely round-off errors(*) because if I can reproduce the problem in 8-bit mode, changing the image to high-precision (32-bit floating point) (Image > Precision) at the beginning of the process makes the problem disappear:
Btw, as shown above, using the Histogram dialog is better than Levels. The screenshot shows that the count of pixels with a ...