Prompt
What should I use to resize and compress images for a website?
Latest observation
Nov 2, 2026
OpenAI APIWeb search: off
For a website, the best choice is usually:
1. Resize first, then compress
Don’t upload huge originals and rely on CSS to shrink them. Instead, create the exact sizes you need:
- thumbnails
- product images
- hero images
- retina versions if needed
2. Use the right image format
- JPEG/JPG: best for photos
- PNG: best for graphics needing transparency
- WebP: usually the best all-around option for web performance
- AVIF: even smaller than WebP in many cases, but check browser support and encoding speed
- SVG: best for icons, logos, simple illustrations
3. Use a compression tool or library
Good options:
- Squoosh (great for manual optimization)
- ImageMagick or libvips/sharp (good for automation)
- TinyPNG / TinyJPG (simple, effective)
- Photoshop / Affinity Photo / GIMP for editing and export
4. If you want automation in a website build
Use:
- Sharp (Node.js) — very popular for resizing and converting images
- ImageMagick — powerful, but heavier
- libvips — fast and efficient, often used through Sharp
5. Use responsive images
Serve different sizes with:
srcsetsizesThis helps browsers pick the smallest useful image.
Recommended practical setup
If you’re building a modern website:
- convert images to WebP or AVIF
- generate multiple sizes
- serve fallback JPG/PNG if needed
- lazy-load below-the-fold images
If you want, I can recommend the best tool based on your setup, like Windows/Mac, WordPress, Node.js, or a static site.