Compression supports speed, not ranking by itself
Smaller images can improve loading experience and reduce wasted bandwidth. That helps users and can support better technical performance signals.
Compression should not make the page less useful. If an image explains the content, keep enough detail for users to understand it.