All the image compressions have their purposes and techniques to use them.

JPEG Compression: It reduces the size of the image by targeting the areas of identical colors. This JPEG compression is useful for photos, gradients, illustrations, drawings, and other similar colorful or rich images.

PNG Compression: It works by minimizing the number of colors used in the image. PNG compression is a great choice for logos, signs, icons, screenshots, and UI elements.

BY Best Interview Question ON 21 Oct 2020