JPEG lossless coding mode
The JPEG format is often called a lossy format because Baseline JPEG results in image quality loss on each save. Baseline JPEG is the most widely used JPEG format, so much so that many people are unaware that there are other types of JPEG. Besides Baseline JPEG, there is also Lossless JPEG and JPEG-LS.
Lossless JPEG saves an image without any quality loss. Lossless JPEG has very poor compression. Lossless JPEG is not recognized by some graphics software that recognizes Baseline JPEG. Loessless JPEG is obsolete.
JPEG-LS, also known as LOCO, was created as a replacement for the original lossless JPEG compression variant. JPEG-LS gives better compression than original lossless JPEG, but still nowhere near what you can get with a lossy method. JPEG-LS is also not widely supported and likely doomed to obscurity.
When you read about JPEG being a lossy format it is not technically and entirely correct, although since most graphics software only supports Baseline JPEG, it is close enough to be widely accepted as accurate for the purpose of the average reader.