Gimp-Forum.net
Sort palette colours - 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: Sort palette colours (/Thread-Sort-palette-colours)

Pages: 1 2


Sort palette colours - meetdilip - 12-03-2019

I used 2.10.14 to create a palette from an image. It has 256 colours and it is sorted in a random manner. Can we sort it automatically in such a way that similar colour shades are grouped together

[Image: mxoBhDP.gif]


RE: Sort palette colours - rich2005 - 12-03-2019

(12-03-2019, 11:46 AM)meetdilip Wrote: I used 2.10.14 to create a palette from an image. It has 256 colours and it is sorted in a random manner. Can we sort it automatically in such a way that similar colour shapes are grouped together

What do you mean by "colour shapes" There is an option to sort a palette in various ways (see your GC post)
or
Parts of an image can be picked out by creating a selection.
A gimp palette is a text file it is possible to join together in a text editor. (Hardly worth the effort)

[attachment=3523]

Remember for a gif animation the image is indexed, uses a colormap and to combine animations with different colormaps you need something like gifsicle which will make an animation with a separate colormap  for each frame.


RE: Sort palette colours - meetdilip - 12-03-2019

Hi rich2005, it was a typo. I meant shades. Inkscape allows to determine the order of colours in palette. That is why I asked about a possible GIMP feature.

Quote:Parts of an image can be picked out by creating a selection.

I didn't follow. Sad


RE: Sort palette colours - rich2005 - 12-03-2019

(12-03-2019, 02:07 PM)meetdilip Wrote: Parts of an image can be picked out by creating a selection.
I didn't follow. Sad

You make the palette from an active selection.

[attachment=3529]

Quote:Inkscape allows to determine the order of colours in palette.

Not aware of that one. Gimp gpl palette format is quite popular. Inkscape uses it. This a comparison between the palette strip in Inkscape and the Gimp palette display. The same order in both.

[attachment=3530]


RE: Sort palette colours - meetdilip - 12-04-2019

Thank you, now I understand.

There is a " generate palette " plugin for Inkscape. It allows you to choose the order of display of colours in the palette.We can group similar shades of a colour just like in default Inkscape palette.


RE: Sort palette colours - meetdilip - 12-04-2019

When I tried using the screenshot of colour palette the .gpl file was all without any order. Colours were displayed randomly in Inkscape as well

Can't we sort it by colours and shades like Inkscape default palette ?

[attachment=3537]

[attachment=3536]


RE: Sort palette colours - rich2005 - 12-04-2019

Quote:There is a " generate palette " plugin for Inkscape. It allows you to choose the order of display of colours in the palette.We can group similar shades of a colour just like in default Inkscape palette.

Yes, but that is a manual sort. You created the order from the selected objects.. A gpl palette is a column of RGB values, top entry is the first colour, last entry is the end colour. looks like this in Inkscape: https://i.imgur.com/hSqjURh.jpg and it is the same in Gimp. You might want to use your sorted Inkscape  palettes in Gimp.

I would say, go back to the Gimp sort palettes and try out the various options. Unfortunately the Gimp 2.10 documentation is lagging behind all you get is the old Gimp 2.8 information. 

However, some comparisons to consider. I think a sort by hue might be what you want or maybe sort by lightness.

[attachment=3539]


RE: Sort palette colours - meetdilip - 12-04-2019

Thanks. I do not see the sort-python option when I right click the palette. I am not sure where to find that plugin either. I searched without luck.


RE: Sort palette colours - rich2005 - 12-04-2019

Told you before. You need to install the ginp-python package in linux Gimp 2.10

In a terminal

Code:
sudo apt install gimp-python

I you want to know where the plugin resides it is in "/usr/lib/gimp/2.0/plug-ins/palette-sort/" but as for all plug-ins and scripts it is run from the Gimp menu system.


RE: Sort palette colours - meetdilip - 12-04-2019

I installed gimp-python that day itself. But I still do not see the option to " sort ".