I most often see this with compressed video, but I've also seen it often enough with JPEG images. Many times blacks, reds, and other generally dark colors seem to be especially prone to compression artifacts, even if you're just opening a file and saving a copy of it. What causes this, and what countermeasures can be taken to prevent it?
My first guess, specifically with JPEG, is that the colour palette doesn't include the colours your seeing as missing. From my understanding, compression algorithms generally try to remove visual or audio bits that a user can't see or hear--at least this is the way it works with MP3.
Another possible reason would be changing the bit level between the original and the compressed version.
Just work in any lossless format (PSD, TIFF, etc. Even PNG if it's for a very basic operation) and save as JPG only in the final export(if you actually need to use JPG), as the final file to be published on the web. Also, there are many ways to export a JPG, some tools allow disabling jpg color artifacts, some even do partial compression per areas of the canvas, etc.