Lossless and lossy are different
Lossless optimization changes how data is stored without changing decoded pixel values. It can remove metadata or improve coding choices. Resizing an image resamples pixels and therefore changes them. The available savings depend on how optimized the source already is.
Lossy compression discards visual information to save more bytes. The change may be hard to see at a chosen size, but it is still a change. A higher quality setting generally retains more information, with a larger file.
Use a visual comparison
Resize to the correct display dimensions before lowering quality. Then inspect fine detail, text, edges and gradients. Keep the original when an asset will be edited again or must preserve exact pixels.
GZ's canvas tools re-encode the image and do not promise lossless output for JPEG or quality-based WebP. PNG output keeps PNG pixel coding but may not become smaller because the browser encoder is not a specialized optimizer.
Frequently asked questions
Can a JPG be made smaller with zero quality loss?
Removing metadata can help without changing visible pixels, but re-encoding JPEG through a browser canvas is lossy and may alter them.