JPEG Image Compression Degradation
Professional photgraphers and graphic designers will be aware that .jpg or .jpeg digital photographs that are to be edited several times should first be saved into a 'lossless' file format such as .tif (TIFF), .png, or .psd. This is because JPEG is a method of lossy compression for photographic images, using an algorithm to a standard specified by a committee called the Joint Photographic Experts Group.
This may seem academic, but anyone who enjoys messing around with .jpg images and ignores this fact risks degrading their quality bit by bit, until they end up with photos of significantly lower quality than the originals, which are perhaps lost forever.
When you open a .jpg image in Adobe Photoshop you should be able to see its kilobyte size down at the left of the status bar towards the bottom of the screen. It might read, say, © Doc: 950K/950K. When the image is saved and closed, its file size will be, say, 323 KB – about one third of what it was when it was open in Photoshop. Other than when it's open for editing, the photo is stored compressed.
Compression permanently removes some of the original .jpg image information, slightly reducing its quality. When the file is next opened, that quality will not be restored, even though it's decompressed and back up to 950 KB in size. If it's saved and closed again, compression removes yet more quality, and so on as the image gradually degrades. This happens even when you don't edit it. If the image is also edited before it's saved, even more of its quality may be lost – I don't know, as I haven't tested this procedure.
Below are two .jpg images. The first is the original file, with beautiful, gently graded skin tones. The second is the same image after it was saved and closed, then opened again, 50 times. It has not been edited in any way but has simply been repeatedly opened, saved, closed. The degradation is clearly visible on the woman's skin, especially on her forehead, nose, cheek, and chin.

The original .jpg photograph

The same photo opened, saved, and closed 50 times
Saving a .jpg image alone has no effect on its quality as long as it's left open, as JPEG works from the on-screen version. Neither does simply opening and closing the image without saving it. The damage occurs only when you save it before you close it. Many people will know that optimizing an image for the web reduces its quality, but this is also the case when the 'maximum' quality setting of 100% or 12 is selected in 'JPEG Options'.
You can eliminate much of the problem by saving the .jpg images that come off your digital camera as .tif (TIFF), .png, or .psd files for editing, and saving them back to .jpg when you're finished.
At this point you optimize an image for the web by saving a version with a lower quality setting than 100%. A setting of 75%, or 'medium', reduces an image file size considerably, making it very much faster to download into a web browser or email client without much visible loss of quality. Note that the optimization process reduces the quality of the image in a different way than when you compress it by merely saving it. The following version of the same photo has been optimized down to a setting of 5% – the degradation is obvious, but different.

The original .jpg optimized to 5%
Considerable loss of detail. Blurry in some places, gritty in others.

