Compress images for the web without quality loss
A repeatable workflow for shrinking JPG, PNG and WebP files: choose the format, resize first, then use quality, target size and live comparison to verify the result.
Large images are usually the easiest performance problem to fix. The trick is to treat compression as a delivery decision rather than a single slider: pick the right format, remove pixels nobody will see, choose a quality level with evidence, and check the result before publishing. A browser-based compressor can do that work locally, so the original file never leaves your device.
Start with the format, not the slider
JPEG remains the default for photographs and complex scenes. Its lossy encoder discards detail that is hard to notice at normal viewing size, which is exactly what you want for a photo. PNG is lossless and supports transparency, so it suits logos, icons, flat-colour graphics and screenshots with sharp edges. WebP is a good choice when you want smaller files with transparency support and you know your audience uses modern browsers.
A common mistake is exporting a photograph as PNG because “lossless” sounds better. The file can become many times larger without any visible gain. The reverse mistake is exporting a logo with fine lines to JPG, where repeated re-encoding produces halos around the edges.
If a file needs a different container before compression, use the format converter first. Conversion and compression are separate steps: one changes how the pixels are stored, the other changes how much data is kept.
Remove pixels before you remove bytes
A 4000 px wide photo displayed in an 800 px column is paying for thousands of pixels the visitor never sees. Set the maximum width to the largest size the layout actually uses, then compress. Doing it in this order produces a smaller file with fewer artifacts than compressing the full-resolution original and hoping for the best.
Keep the aspect ratio locked unless the design demands an exact box. If you need a different crop, make that decision deliberately with a cropping tool rather than letting a width cap guess for you. The image resizer handles dimension changes with the ratio preserved, which is safer for batches containing photos of different shapes.
For high-density screens, a useful rule of thumb is to export at roughly the display width multiplied by the device pixel ratio you care about, then stop. Chasing every possible retina device with a giant source file wastes bandwidth on visitors who cannot use those pixels.
Understand what quality values actually do
For JPEG and WebP, the useful range for most web images is around 75–85. Below roughly 70, blocking becomes visible around high-contrast edges and text. Above 90, files grow quickly while the visible improvement becomes hard to justify. PixelShift starts at 78 for compression, which is a sensible baseline rather than a universal answer.
Use a preset as a starting point, not a finish line. The Web optimized preset keeps quality near 80 and caps width at 1920 px, which fits many article and product layouts. The Email friendly preset is designed for attachment limits. From there, adjust in small steps and compare at the same zoom level.
Never judge quality on a whole-image thumbnail. Zoom to 100%, look at an area with fine texture — hair, grass, fabric, lettering — and compare the original with the result. If the difference is invisible at the size you will publish, keep the smaller file.

Use target size when a limit is non-negotiable
Sometimes the decision is already made for you: a form rejects uploads above 2 MB, a product card must stay below 300 KB, or a whole email needs to fit a mailbox quota. Guessing a quality percentage is slow. Enter a target file size in kilobytes and let the encoder search for the highest quality that still fits.
Target mode is most useful when dimensions are already sensible. If the requested size is unrealistically small for the pixel count, the encoder has to throw away too much detail. Reduce dimensions first, then set the target. A 1200 px wide image can fit a tight budget far more gracefully than a 5000 px one.
A good workflow is to set the target slightly below the official limit. That leaves room for filenames and metadata differences and avoids a last-minute failure when another system counts bytes differently. If the tool cannot reach the target without visibly damaging the image, treat that as a signal to change the image rather than fighting the encoder.
Know what is happening inside the browser
PixelShift runs compression locally with Canvas and WebAssembly: MozJPEG for JPG output, libwebp for WebP output and OxiPNG for lossless PNG optimization. OxiPNG repacks PNG data without changing pixels, so it is safe for graphics that must stay exact. For photographs with transparency, WebP will usually beat PNG by a wide margin.
On the first compression export, the browser downloads a small codec of roughly 100–300 KB from the site’s own files. It contains program code, not your image data, and the browser caches it. Later exports start immediately, including on repeat visits. Nothing is uploaded to a server, so there is no queue and no remote copy of the original.
Because processing is local, practical limits come from the device rather than an upload form. Very large images still need memory, so keep backups and avoid compressing the only copy of an important file.
Compress batches as a system
When a page uses a set of images, consistency matters. Drop the whole folder into the homepage compression console, apply one set of settings, and check a representative image at full zoom before exporting everything. Multiple results can be downloaded individually or bundled as a single ZIP, which is much easier than collecting files one by one.
Watch out for mixed content in one batch. A screenshot, a logo and a photograph rarely want the same format. Split them into groups if necessary: PNG or WebP for the graphics, JPEG or WebP for the photos. A single quality value can be convenient, but it is not always correct.
Filename hygiene pays off here. Keep source names meaningful, and avoid overwriting the originals. If a CMS generates its own derivatives, compress only the master you actually supply and let the platform handle the rest.
Verify before you publish
A short checklist prevents most complaints:
- Check the final byte size against the real limit, not the number you expected.
- Confirm the pixel dimensions match the layout.
- Compare one detailed area at 100% zoom against the original.
- Open the exported file on a phone, not only on a large desktop monitor.
- For transparent images, check the edge over a dark background.
Compression is not a one-time chore. Every new batch is a chance to apply the same decisions more quickly. Once you have a baseline for your site’s image sizes, the workflow becomes routine: resize, choose format, compress with a target or preset, inspect, export. The rest of the PixelShift guides cover the related edits that often come before compression, from cropping to background removal.