Why decimal gray value in a 8 bit image

Hello everybody,
I apologize if this has been answered previously.
I am converting a RGB image to 8 bit image. I assume that the resultant intensity values should be integers between 0 and 255. However I get numbers with decimal values, like. Min 54.752 Max 241.427

In Image Info it says:
Bits per pixel: 8 (grayscale LUT)
Display range: 0-255

Does anybody understand why I get decimal values?

Thanks in anticipation for any help

You will find some answers here:

30.7 Set Measurements…

With RGB images, results are calculated using brightness values. RGB pixels are converted to brightness values using the formula value = (red + green + blue) ⁄ 3 or value = 0.299 × red + 0.587 × green + 0.114 × blue if Weighted RGB Conversions is checked in Edit▷Options▷Conversions…↑.

Hope this helps
Thank you

Does the image have a calibration function? It would help if could save the image in TIFF format and post it.

I just discovered that this happens (the decimal gray value) if I define an area within the image with the segmented line tool, that, by the way, I am not able to close. If I define rectangle or oval tools (that are closed by definition),then the gray values are integer within 0 and 255

Hi Mathew and Wayne,

I think that the problem is with open segmented areas, as I said before, not with the conversion from RGB to GRAY.

I am including a RGB tiff image whose closed outer square has Min 133 Max 249. The inner open square has Min 161.642 Max 247.920. I still don`t understand where those decimal numbers come from.

Thanks in advance for the help


Close square versus open segmented square.tif (930 KB)

Hi, again.

I solved the problem using the polygon selection tool.

However, I still don’t understand where decimal gray values come in the segmented line tool.

Thank you very much!!


ImageJ uses interpolation to measure pixel values along line selections.

1 Like


Thank you very much!


Interpolation for line profiles can be toggled in Edit › Options › Plots…: