Gimp-Forum.net
Average colour in GIMP - one click - Printable Version

+- Gimp-Forum.net (https://www.gimp-forum.net)
+-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP)
+--- Forum: Extending the GIMP (https://www.gimp-forum.net/Forum-Extending-the-GIMP)
+--- Thread: Average colour in GIMP - one click (/Thread-Average-colour-in-GIMP-one-click)



Average colour in GIMP - one click - chuckhenrich - 12-01-2025

I’ve published a new plugin that generates the average colour for any RGB or greyscale image. It sits at the end of the Colors menu: “Average colour” (after you install it properly of course).

I was surprised that average colour wasn’t a thing in GIMP. I did a lot of research and discovered the topic generated various solutions that were all challenging in one way or another.

Then I found a thread from 2014 where someone suggested a really simple manual approach. So I took that as inspiration and automated it.

You can read more about it and download it here:

https://www.chuckhenrich.com/average-colour-gimp-plugin/

Also, I wrote a follow-up blog post on the wider topic of the importance of using industry standards in GIMP, with average colour as an example:

https://www.chuckhenrich.com/average-colour-in-gimp-industry-standard/

The plug-in is available in the following languages:

Dutch (Nederlands)
English (English)
French (Français)
German (Deutsch)
Italian (Italiano)
Hungarian (Magyar)
Japanese (日本語)
Polish (Polski)
Portuguese (Português)
Spanish (Español)
Ukrainian (Українська)
Chinese (Simplified) (简体中文)
Chinese (Traditional) (繁體中文)

Feedback and suggestions welcome and encouraged!


RE: Average colour in GIMP - one click - Scallact - 12-01-2025

I consider your plugin as an essential from now on. Thanks for your work, and the explanations. And for sure, I'll use the method in some of my plugins where I used some ugly hacks to achieve a less than ideal result.

You rely on the histogram for your calculations. It would be interesting to know how GIMP's histogram calculates its means, and which color space it uses, sRGB or the color profile of the image. The API function Gimp.Drawable.histogram() documentation is not very clear about it, and  it would validate the method "scientifically".

Thanks a lot for sharing!

P.S: just a small note: I think it's generally considered good practice to put a personal prefix in front of one's plugin's name, to avoid possible naming collisions in the future.