Yes, Magento 2 has default settings for Image compression. But with that, you may end up with low-quality images. Also, only the product images can be optimized. We recommend you use the Magento 2 Image Optimizer Extension or