I wish I had never entered this topic. I appear pedantic as I try to wrestle with explaining technology I barely understand to people who may be less technical than me. Yet at the same time I often enjoy sharing my enthusiasm for technology and science with those who have not gone into it as much as I have.
To start off, your picture as taken on the sensor in the camera is compressed before you ever see it. Our eyes are far more sensitive to green than any other color (our eyes peak at green). Digital camera sensors are divided into red, green and blue sensors (RGB) but they are arrayed as RGBGRGBGRGB, in other words red-blue-green-blue with twice as many greens as reds or blues. As I understand it our eyes peak in acuity in the green region, so it requires more accent on green than on red or blue to create the fine image of the picture, but of course you need the green and red to differentiate the colors. As I understand it the camera calculates two versions of the image, a grey scale bit map of the image detail, and an RGB color image of the colors, and then combines them to produce the image that is saved to the camera's memory.
If I remember correctly the most detail is saved in a TIF image, then BMP (bit map) and then after that JPG and so on. As you progress up the scale the images get less detailed and smaller, more compressed.
As I type this it is all from my memory so I hope I haven't got the facts wrong. You would have to save an image in raw format, RGBG-RGBG-RGBG format to have it not compressed. I'm not sure if cameras even have this available as a user format.
All JPG files are compressed to some degree, and the protocol can be adjusted to almost any desired degree.
JPEG - Wikipedia, the free encyclopedia