Gimp-Forum.net
How can I separate an into groups? - Printable Version

+- Gimp-Forum.net (https://www.gimp-forum.net)
+-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP)
+--- Forum: General questions (https://www.gimp-forum.net/Forum-General-questions)
+--- Thread: How can I separate an into groups? (/Thread-How-can-I-separate-an-into-groups)



How can I separate an into groups? - pixaeiro - 12-07-2020

Hello,

Is there any GIMP tool or plugin that can be used to separate an image into groups with the same color?

This is what I'd like to achieve:

[Image: w8SUX5F.png]

I created the layers using the fuzzy selection tool and pasting the selection as a new layer. I'd like to do something like this but with one click... like when using Filter > Enhance > Wavelet-Decompose or Colors > Components > Decompose.

Thank you!


RE: How can I separate an into groups? - rich2005 - 12-07-2020

You could try the gimp_gmic_qt plugin. Get the Windows installer from http://www.gmic.eu

Look for the filter Layers -> Colors to Layers and play around with the settings.

example: https://i.imgur.com/j3gK1SJ.jpg


RE: How can I separate an into groups? - pixaeiro - 12-07-2020

Thank you Rick,

This looks very close to what I need, but I'm getting the green and purple in just one layer each, and I need them to be in two different layers.
Imagine that you have an image with green toy soldiers in a white background and you need to count the number of soldiers:

Like this:
https://pixabay.com/photos/symbol-army-soldiers-toy-figures-19896/

I've found that the name of this image processing technique is connected-component labeling, but I can't find a GIMP or G'MIC tool that does this.


Thank you very much for your reply!


RE: How can I separate an into groups? - Krikor - 12-07-2020

[attachment=5300]
I obtained the result of the image above by following the steps below:
01 - Filters - Colors - Indexed Decomposed
Then apply:
02 - Layer - Extract Objects - Extract Objects to Layers (adjust the threshold)


RE: How can I separate an into groups? - Krikor - 12-07-2020

(12-07-2020, 01:53 PM)rich2005 Wrote: You could try the gimp_gmic_qt plugin. Get the Windows installer from http://www.gmic.eu

Look for the filter Layers -> Colors to Layers and play around with the settings.

example:  https://i.imgur.com/j3gK1SJ.jpg

Following the tip of rich2005 the result was much better:
01 - G'micQT - Layers -> Colors to Layers
Then apply:
02 - Layer - Extract Objects - Extract Objects to Layers (adjust the threshold) for layers with more than one color per layer; green and pink.
03 - Erase the initial layers that had two objects per layer.
[attachment=5301]


RE: How can I separate an into groups? - pixaeiro - 12-07-2020

Hello Krikor,

I found Filters - Colors - Indexed Decomposed as a script-fu (Indexed Decompose)

But I can't find Layer - Extract Objects - Extract Objects. Is this a plugin or script?

Thank you f


RE: How can I separate an into groups? - Krikor - 12-07-2020

Hi pixeiro,

I confess that I didn't know how to answer this question, but I did some research and found that this is one of the great plugins for Ofnuts.

You can find it here:
https://sourceforge.net/projects/gimp-tools/files/scripts/

Bbt I suggest using G'MIC as suggested by rich2005, the result is better and without having to convert to Indexed Mode first.


RE: How can I separate an into groups? - pixaeiro - 12-07-2020

Hello Krikor,

Yes, I think I have enough info to solve my issues!

Thank you for the Ofnuts scripts link.