Every time you save an image in the jpeg format, or any other compressed format jpeg is just the most common, you lose detail and create artifacts.
And many may not realize many video formats are just still jpeg images in series similar to how movie film works.
That why it's best if photoshopping your photos to start from the original if possible if you want the best possible quality.
The way around that is to save in an uncompressed format such as RAW but they're huge. Many cameras will allow you shoot in RAW rather than jpeg or even both at the same time.