Good stuff. I suggest you do this for all file formats, eg GIF and JPG and anything else G’MIC can read.
You might also make available (in a variable or whatever) the nominal maximum value, which might be 1.0 or 255 or 65535 or whatever.
This would reduce the need to assume that the maximum actual value in an image is also the nominal maximum value.