A JPEG is lossily compressed, this means it loses information compared to the original. It does this by creating an approximation of the image aimed at looking like the original to a human viewer.
Lossy audio codecs like MP3, AAC, Opus etc. do the same thing with sounds, get it to sound close enough to the original with a fraction of the data. And the same goes for video codecs of course.
Some (especially newer) codecs are better than others at creating the same perceived quality with less data (or a higher quality with the same amount of data). This is why YouTube for example is testing AV1 now, it's more efficient than older ones like AVC/H.264 and VP9.
JPEG has held on so long because it's "good enough" (the enemy of "better") and images tend to be small in file size. But there are also interesting newer formats like AVIF which basically encodes an image as a single-frame AV1 video.>If your camera only does jpegs, what all are you losing as far as image data?
You're losing the original image data. You can make JPEG's compression artifacts more visible by taking a good quality image and saving it as JPEG with quality set to 30 or so in an image editor.
Pic related is what happens when you save a JPEG over and over, the tiny errors accumulate until it's just noise. Had to compress it as a high-quality itself because of the 5MB size limit here lol
Apart from the lossy compression, there are two other problems:
- Your cam most likely uses chroma subsampling, this means that the colors are saved at a lower resolution than the brightness in the image to save data.
- JPEGs have 8 bit color, this means for every color channel (red, green, blue), there are 256 possible brightness steps. RAW files come in 12 bit (4096 steps per color) or even more.