How to recieve Brightness-Value?



I’m just starting to use ImageJ.

I work with the Color-Threshold-Feature and managed to use the Macrofunction for it.
The problem is, that each of my pictures has a slighty different Brightness-level.
I was wondering, if its possible to get the highest Brightnessvalue.
I can look it up manually: Analyse -> Histogram -> List
For my sample Picture the highest value is in Row 200 ->270103
I’m looking for a command to get ‘200’ as a Result.
I found the

Does anyone know a solution?

Kind regards


Good day Tobias,

you write and the topic implies that you are loooking for the maximum value of images:

if its possible to get the highest Brightnessvalue

but then you want the position of this value:

the highest value is in Row 200 ->270103

So what is your desire?




Yes,I wanted to use the position(!) for a Colourthreshold-macro.
It took some time but i figured it out already :slight_smile:
Don’t think it is very smooth but it works.

 getHistogram(values, counts, 256); 
      itemp = counts[1];
for( i=0; i<255; i++) {
     if (itemp<(counts[z])) 
		itemp = counts[z];
		pos= z;
      print(pos, counts[pos]);

Thank you


Sorry Tobias,

but how do you expect to get a position in the image from its histogram.