Prompt
How do I resize images for my website without killing quality?
Latest observation
Nov 2, 2026
OpenAI APIWeb search: off
To resize images for a website without hurting quality too much, the key is to match the image’s pixel dimensions to how it will actually be displayed, and use the right file format.
Best practices
1) Resize to the actual display size
Don’t upload a 4000px-wide photo if it only shows at 800px on your site.
- If an image displays at 800 × 500, export it around that size
- For retina/hi-DPI screens, you can export at 2x that size if needed
- e.g. display at 800px wide, upload a 1600px wide version
2) Use the right format
- JPEG/WebP/AVIF: best for photos
- PNG: use for graphics, transparency, sharp text-like images
- SVG: best for logos, icons, and simple illustrations
If quality and file size both matter, WebP or AVIF is usually better than JPEG/PNG.
3) Don’t upscale small images
If an image is 300px wide and you stretch it to 1200px, it will look blurry.
Always start with a source image that’s at least as large as the biggest size you’ll need.
4) Use high-quality resizing tools
Some tools preserve detail better than others:
- Photoshop: “Bicubic Sharper” for downscaling
- Lightroom / Affinity Photo / GIMP: good resizing options
- ImageMagick: solid for batch resizing
- Online tools can work, but make sure they don’t heavily compress the image
5) Save with sensible compression
When exporting:
- Keep JPEG quality around 70–85 for web use
- Use WebP/AVIF with moderate compression
- Avoid repeatedly re-saving the same file, which can degrade quality
6) Serve responsive images
Use multiple sizes and let the browser choose the best one.
Example:
<img
src="image-800.jpg"
srcset="image-400.jpg 400w, image-800.jpg 800w, image-1600.jpg 1600w"
sizes="(max-width: 800px) 100vw, 800px"
alt="Example image">
Simple workflow
- Start with the highest-quality original
- Resize to the largest needed display size
- Export in WebP/JPEG/PNG as appropriate
- Use
srcsetfor responsive delivery - Test on desktop and mobile
Quick rule of thumb
- Photos: export at display size or 2x, use WebP/JPEG
- Icons/logos: use SVG
- Transparent graphics: PNG or WebP
If you want, I can give you:
- a Photoshop/GIMP workflow
- a command-line/ImageMagick batch script
- or a WordPress/website-specific setup