Hi Mike,
convert to 32 bit unsigned integer format (pixels should be unchanged at 128)
No, it doesn't work this way. In 8-bit unsigned integer format, the representable range of the image is [0,2
8-1], or [0,255]. In 32-bit unsigned integer format, it is [0,2
32-1]. Therefore, after you perform the conversion, the 32-bit pixel value is:
128/255 * (2
32-1) = 2155905152
Now the rest of your results explain by themselves.
PixInsight can work with five pixel sample formats (8-bit, 16-bit and 32-bit unsigned integers, plus 32-bit and 64-bit floating point) transparently.
Transparently here means that the pixel data are stored in their respective formats in memory (for example, for an 8-bit image, each pixel of a color RGB image occupies 24 bytes), but you can see and work with them as virtual pixels in any arbitrary format of your choice. All image processing tools and algorithms can work with any of the five formats, also transparently.
The normalized real range [0,1], which is used pervasively on the PixInsight platform, is an abstract range that allows you to work uniformly with any pixel sample format, current and future. For example, in your test case:
128/255 = 2155905152/(2
32-1) = 0.5019607843137255
In the normalized real range, 0 is black and 1 is white, irrespective of the actual pixel sample format of the image. Floating point images are internally stored and manipulated in this range in PixInsight, which has important algorithmic advantages.
Unfortunately, many users still don't understand this and persist using pixel readouts in native pixel sample formats. This is a serious error in PixInsight. From a purely practical and logical perspective, once you get accustomed to the fact that .37 is just a 37% of the black-white range, you'll find it much easier to work this way than thinking in terms of 94.35, 24247.95, or 1589137899.15.