Doesn't changing the colors and/or contrast change the data? Not at all. Try this:
Change the color map with the color menu, or change the contrast by moving over the image with the right mouse button pressed. Go back to the x,y location of 4158,4398 in the "physical" line. What "value" is displayed? Again it is 92. Why is this?
ds9 is not changing the value of each pixel when you change colors. Rather, it is simply changing the color assigned to that given number of photons. When the grey colors are used, then ds9 assigns grey colors to pixel values ranging from 0 (black) to 255 (white)
When the contrast is changed, the assignment of colors is changed, not the data values. You can see the rough assignment of color to pixel value in the color bar under the image.
Watch what happens to the color bar while you change the contrast (right mouse button) or the whole color scheme (color menu).
The color bar can be roughly divided into 256 pieces, each of which is assigned a color corresponding to 256 possible pixel values. What happens if a pixel has more than 256 X-rays and therefore a value of more than 256? (see More on Scaling in the box below)
More on Scaling
Binning Pixel Values by Scaling
In order to display a large range of pixel values with a limited number of color levels (typically 256), image data must be binned according to some scaling function. A number of different functions are supported, including:
Linear Scaling: The range of pixel values is divided by the number of color levels to determine the range of pixel values for each color level. The fixed range is applied to mapping all pixel values between the minimum and maximum pixel value.
Square Root Scaling: Imagine that you have two pixels with intensity values of 25 and 100. If these were displayed with a linear scale, the brighter one would be 4 times the intensity of the fainter one. But if you use square root scaling, the relevant values are 5 (the square root of 25) and 10 (the square root of 100). Now, the brighter pixel is just 2 times the intensity of the fainter one. So you have effectively emphasized the faint values of the image in this map!
Try experimenting with the various scaling functions, and see whether they emphasize the bright or faint features of the displayed images. This is fun!