GNOME Bugzilla – Bug 51563
"Count colors" option
Last modified: 2004-12-22 21:47:04 UTC
I really could use a "count colors" feature, like has been in Paint Shop Pro for a while. This just looks over the entire image (but you could have it look over a selection, the visible layers, ...) and tallies up all colors that are unique (ie, same RGB used by multiple pixels), and gives the user a count of colors. This can then be fed into the "indexed" depth converter to make the smallest possible palette without losing any image quality. Of course, this could also be integrated directly into the indexed depth converter, so you could just put a special value in the "# of colors" field (like 0) and have gimp automatically choose the optimal palette without any quality loss.
If you convert the image to indexed mode and specify the maximum (256) for the number of colors, the GIMP will allocate at most 256 colors, but not more than the number of colors included in the RGB image. If you take any RGB image, convert it to indexed mode, then look at "<Image> -> View -> Info Window...", you will see the number of colors that have been allocated. Do you think that a "Count Colors" option would be more useful than this? Please reply to this so that I know if the bug should remain open or if it can be closed.
Re-assigning all Gimp bugs to default component owner (Gimp bugs list)
The indexed conversion in Gimp is designed to give the best possible results without the need for user intervention. It will automatically use the lowest possible number of colors without degrading image quality. If indexed-conversion is the only use for a "Count Colors" option, then we simply don't need it.
reassigning to current CVS since it's a wishlist item
Let's add the following as a wishlist item: add a "Count Colors" option that works in all modes (RGB, grayscale, indexed) and counts the number of unique colors in the image. It could be useful to know the number of unique colors before converting the image to indexed mode, in order to guess how many of them would be lost in the conversion (if their number is larger than 256). This option should probably be combined with an histogram, since the only way to count the number of unique colors is to build a list of them. The only problem is how to represent a RGB color histogram in 4 dimensions...
There is a pug-in called 'ccanalyze' which does provide this feature. It lives under : <Image>/Colors/Colorcube Analysis if found in the plug-in registry at: http://registry.gimp.org/plugin?id=363
I noticed this while reading the TODO file and i thought it was strange that it was not mentioned here http://cvs.gnome.org/lxr/source/gimp/TODO#308 Ability to get an exact count of the total number of colors in the image: Xpm plugin has an algo to do this. Should be trivial to add this to the core.
As you could have easily found out using Bonsai, the TODO file hasn't been updated in years. It is completely obsoleted, deprecated and I finally removed it.
*** Bug 113648 has been marked as a duplicate of this bug. ***
Hi, First, excuse me if I make a mistake, I use French UI. On MSWin Gimp 1.2.3 only, this function is accessable with picture/colour/colorcube analysis. But maybe it should be in information windows. NOTA : I copy this info in bug 113648.
"<Image>/Image/Colors/Colorcube analysis" http://registry.gimp.org/plugin?id=363 Thanks for the information, it is good to know that the feature is available. I checked and old version of gimp-1.2 on Linux, it does not include the Colorcube Analysis Plugin, I will try and remember to check gimp-1.3 on my home machine later. Does the fact that the feature is already avialable make this a usabiliy bug[1], or a please ship this plugin[2] request? Even though the ColorCube Analysis plugin does a lot more than just Count Colours, it would probably help a lot of users if it were labelled as "Count Colours" (or Count Colors ;). I realise that this might be unnacceptable dumbing down, and I would welcome a better solution. [1] add keyword usability [2] move to component Plugins
Bumping a bunch of enhancement requests which will not be done by the feature freeze to Future. Dave.
This looks like trampling an extremely low hanging fruit. Why not simply include the plug-in in The Gimp ? A ported to 1.3.x version will follow. So it's just a matter of allowing it to go in.
Created attachment 18645 [details] ccanalyze.c ported to Gimp 1.3.x
Adding PATCH keyword so that this gets done before the freeze. Dave.
Added a further cleaned up version, plus support for grayscale and non-interactive mode. 2003-07-30 Manish Singh <yosh@gimp.org> * plug-ins/common/Makefile.am * plug-ins/common/plugin-defs.pl * plug-ins/common/ccanalyze.c: new plug-in, Colorcube Analysis (counts colors in an image, an often requested feature)