By PixelSqueeze Team · Published October 17, 2026 · Updated October 17, 2026
Start with the job the image must do
Web image optimization means delivering enough pixels and visual detail for the page while avoiding unnecessary bytes. It is not simply turning quality down. A 6000 × 4000 camera image used in a 700-pixel content column has far more source pixels than the page needs on a typical display. Resizing that image before encoding can reduce its dimensions by a large factor, which often matters more than a small adjustment to quality.
First identify the role: hero, article photo, thumbnail, logo, or screenshot. The role determines display dimensions and whether crisp edges or transparency matter. A hero may need a larger source than an avatar, and a logo may benefit from vector artwork or PNG rather than a photographic format.
Choose dimensions from layout
Measure the largest rendered width in the page layout and consider high density screens. If an image appears at 700 CSS pixels, a 1400-pixel-wide source may provide a useful 2× version where that level of detail is needed. This is a starting point, not a universal requirement; responsive image markup can deliver different files to different viewport sizes. Avoid exporting every image at the full camera resolution by default.
Keep the aspect ratio unless the design intentionally crops the image. For a 3:2 source at 2400 × 1600 pixels, reducing its width to 1200 pixels results in 800 pixels high when the ratio is preserved. Forcing it into 1200 × 600 distorts the subject unless the page uses a deliberate crop. PixelSqueeze resize controls cap dimensions without upscaling.
Choose a format
Photographs generally suit JPEG or WebP. WebP can be compact and supports transparency, while JPEG is broadly compatible. PNG is useful for transparency, hard-edged graphics, screenshots, and images where lossless storage matters, though photographic PNGs can be relatively large. SVG is ideal for many logos and icons when a clean vector source is available. Animated artwork needs a format and pipeline that preserve animation.
Do not convert a transparent asset to JPEG without deciding what background should replace transparency. Avoid treating every PNG as a photo: a screenshot with labels can become blurry if encoded with strong lossy compression. Compare WebP and JPEG outputs for photographic content using the WebP converter or PNG to JPG converter.
Compress in a controlled sequence
Keep the original untouched. Create a working copy, resize it to the intended delivery dimensions, and encode it in the candidate format. Then compare the result at actual display size. If it looks clean, stop. If a visual defect appears, increase quality, select a less aggressive format, or reconsider the dimensions. Each adjustment should address an observed problem.
A practical example: a 4032 × 3024 phone photo used in a 900-pixel card can first be reduced to a width appropriate for the card and its responsive density. Export a WebP and a JPEG from that resized source. Check fine foliage, hair, and gradients. If the card is viewed only as a small thumbnail, details invisible at that size need not be preserved at full-resolution cost.
| Format | Strength | Consideration | Typical use |
|---|---|---|---|
| JPEG | Broad photo compatibility | No transparency | Photo sharing |
| PNG | Lossless pixels, alpha | Photos can be large | Graphics and screenshots |
| WebP | Lossy/lossless, alpha | Check destination | Web delivery |
Measure and inspect
Record output bytes as well as dimensions. File size is not a quality score, and a smaller file is not automatically better. An image that loads quickly but makes text unreadable or faces smeared is a poor result. Check the page in its real browser context, including mobile layout, lazy loading behavior, and the crop. For transparent images, inspect edges against both light and dark backgrounds to catch halos.
If you have an explicit upload ceiling, target it with margin rather than attempting to land exactly on the boundary. Some systems count units differently or impose separate pixel limits. The compress to 100 KB tool can produce a file near a common example limit, but always verify the destination’s current rules.
Avoid common optimization traps
Do not recompress a compressed export repeatedly; start again from the source. Do not strip color profiles without understanding how the destination interprets color. Do not resize upward to meet a nominal pixel dimension because that creates no real detail. Do not rely on one quality number across different encoders. Do not overlook filenames, alternative text, and dimensions in page markup; optimization also includes describing and presenting the image properly.
A modern website can serve responsive variants with width descriptors and let the browser choose a candidate. That improves on sending the same large file to every device. A static page may simply use a carefully sized asset. In either case, confirm the actual URL delivered by the page and not just the copy stored on your computer.
Conclusion
A repeatable process is more reliable than a magic setting: decide the display size, choose a format that suits the content, compress from the original, and inspect the exported file. Start with the browser image compressor, then keep the source file available for future revisions.
Related posts
Frequently asked questions
Which format creates the smallest image?
It depends on image content, dimensions, encoder, and quality. Compare exports from the same original and inspect at the intended size.
Will conversion restore lost detail?
No. A conversion cannot recreate information discarded during an earlier lossy export. Return to the original when available.
Should I delete my original?
Keep it if you may need future edits, a different crop, or another format. Delivery copies are not source masters.