Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Average colour in GIMP - one click
#8
Zbyma72age
(12-02-2025, 08:57 PM)Ofnuts Wrote: For me definition of "average" is whatever Gimp picks when you use the color picker with the Sample average option. On a B&W checkerboard, Gimp 2.8 picks #808080, and Gimp 2.10/Gimp 3.x pics #bcbcbc.

The acid test is to paint over the area using the picked color,  normally it should hardly be visible.

I found out that the Chuck Henrich 2025 average-image-colour-v3.py plugin gives an incorrect result because:
In the helpers/get_average_color file, it counts the average in sRGB space by gamma:
r, g, b = get_average_rgb(drawable) ie.
The average of the values after the gamma curve (and non-linear).
Only then does it convert this already bad average to linear: r_lin = srgb_byte_to_linear_component®
As far as I know, DO NOT count the average on sRGB data (after gamma).
Is this true, because the results are always darker.

Please no green text  Sick

You're right in a general image manipulation scenario. However it may differ depending on the use case. I use GIMP to create height maps, and in such files, the actual rgb values code the altitude. So, the average height must be calculated without conversion to linear.

For photos, which is the case the OP describes, I think that Photoshop is definitely wrong, whatever industry standard it represents. But I can also see cases where one technique would be preferable than the other. In short, I'd rather have the choice.
Reply


Messages In This Thread
RE: Average colour in GIMP - one click - by Scallact - Yesterday, 07:40 PM

Forum Jump: