Working with Media - What Are Common Ways to Optimize Media Assets? - question feels wrong

Tell us what’s happening:

the following question on the tutorial feels wrong:
Which file format should you never compress?
i selected PNG but it shows that i selected the wrong answer.
It says “This format is not lossless, so compressing it would result in a degraded quality.”
so if compressing PNG would result in degraded quality, does not that mean that we should not compress PNG?
why was my selected answer wrong? is this a mistake?

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36 GLS/100.10.9939.100

Challenge Information:

Working with Media - What Are Common Ways to Optimize Media Assets?

Welcome to the forum @tarundagar

Thank you for helping make FCC better. Bugs can be reported as GitHub Issues. Whenever reporting a bug, please check first that there isn’t already an issue for it and provide as much detail as possible.

It looks like all three distractors are loseless, including PNG, but the hint message is providing incorrect information about the selected image format.

Happy coding

The video indicates that you shouldn’t compress JPG:

There are options like pngcrush to compress your images locally, or you can use online compression tools. However, it’s worth noting that specific file formats, such as JPG, are not lossless. Lossless means that the original data can be perfectly reconstructed from the compressed data. If you try to compress a JPG image, it will result in a degraded quality. You should keep all these things in mind when selecting images for your web pages.

Which I did find pretty confusing and unclear.

  • JPG is already compressed so you DO compress JPG
  • You can recompress it if you want, yes it will lose quality but that’s anyone’s choice.
  • There are various levels you can compress it
  • You could losslessly ZIP compress a jpg if you were sending it to someone (probably not going to compress it very much… might even get bigger with overhead)
  • You can lossy compress PNG files using pngquant

To say you should never compress JPG I find a bit odd. It is important to understand lossy vs. lossless compression.