Short answer
Compress website images after choosing the right displayed dimensions and format. The best result is not only a smaller file: it still looks acceptable at the size visitors actually see.
When this applies
Use this before publishing hero images, blog media, product screenshots, portfolios, and documentation. It is especially useful when source files are larger than their rendered dimensions.
Practical review steps
- Resize oversized images before judging compression quality.
- Compare the compressed file size with the original and inspect both at the intended layout size.
- Keep the original source so a visual regression can be corrected later.
Check the actual color pair
Use the free Image Squeeze with the foreground and background colors from the real component. It provides an immediate AA and AAA ratio check in the current browser tab.
Source and limit
For the formal requirement, review W3C's WCAG contrast minimum guidance. A ratio result checks a color pair; it is not a complete accessibility audit.