Image Tools

Compress JPG, PNG, And HEIF Images With Better Results

Image compression is a balance problem: too light and the file stays too large, too heavy and quality drops to the point where the image looks worse than not having one at all. The tradeoff is real but navigable once you understand what each image type can tolerate. This guide helps you choose the right approach for photographs, screenshots, and mobile photos — and avoid the common mistake of applying the same settings to every image regardless of content type.

By Praveen Kumar V 7 min read Published 2026-03-15  ·  Updated 2026-04-13

This guide maps to the tool directly so you can apply each step while reading.

Match the compression approach to the image type #

Photographs — images captured by cameras with complex gradients, texture, and natural lighting — handle moderate to aggressive compression well. The compression algorithm finds many opportunities to reduce data in photographic content because human vision is less sensitive to small color variations in complex scenes. A high-quality camera photo at 5 MB can often compress to 300 to 500 KB with minimal visible loss at screen viewing sizes.

UI screenshots, diagrams, and images with text or sharp graphic elements are much less tolerant of compression. These images contain hard edges, uniform color regions, and precise lines that compression algorithms struggle with. Applying heavy JPG compression to a screenshot creates visible blocky artifacts around text and edges that immediately signal poor quality. For these images, use very light compression or convert to PNG, which uses lossless compression.

HEIF images from modern iPhones and Android devices are already compressed by the camera using efficient algorithms. Further compression gives diminishing returns and can occasionally produce files slightly larger than the original because you are adding another compression layer over an already-optimized file. For HEIF images destined for web or email use, converting to WEBP or JPG first and then compressing at a moderate setting usually gives better results.

Logos and brand graphics should never be aggressively compressed as JPGs. The sharp edges and uniform color regions that define a logo are exactly what JPG compression destroys most visibly. Keep logos as PNGs for most uses, or as WEBP if you need both transparency and reduced file size. The savings from compressing a logo as a JPG rarely justify the visible quality loss.

Batch processing strategy for efficient workflows #

Group images by type before processing in a batch. Photographs should be processed with settings appropriate for photographic content, and screenshots and UI assets in another group with different settings. Running all types together with a single compression setting produces inconsistent output — some images will be overcompressed and others undercompressed.

For large batches, process a sample of ten to fifteen files first. Check the output quality and file sizes. If the sample looks good and sizes meet your targets, apply the same settings to the full batch. This small validation step saves the time of reprocessing hundreds of files because the settings were wrong.

After processing a batch, do not review every file. Instead, open the five images most likely to show quality issues — those with the sharpest text, most uniform color regions, and highest contrast areas. If these look acceptable, the rest of the batch almost certainly will too. Spot-checking extreme cases gives high confidence without reviewing every file individually.

Keep original files in a separate folder and never overwrite them with compressed versions. Clear naming — product-photo-01-original.jpg and product-photo-01-compressed.jpg — prevents accidental replacement. If you need to recompress for a different quality target later, you want the original available, not a previously compressed version.

When compression is not enough #

If compressing an image still leaves it too large, the most effective next step is usually to reduce pixel dimensions, not compress harder. Pixel reduction gives a much larger file size reduction than quality reduction. Cropping away unused border regions, or resizing an image to its actual display dimensions rather than its capture dimensions, often achieves in one step what aggressive compression tries and fails to do while degrading quality.

A common example: a camera photo at 4000x3000 pixels uploaded to a blog post that displays images at maximum 800px wide. The image contains four times as many pixels in each dimension as the display size requires. Resizing to 800px wide before compressing will produce a file that is dramatically smaller and just as sharp at its display size as a heavily compressed full-resolution version.

Converting to a more efficient format can also produce significant size reductions. Converting a PNG photograph to WEBP — even without aggressive compression — typically reduces file size by 25 to 35 percent. If your images are stored as high-quality PNGs and you need to reduce size for web use, a format conversion to WEBP is often more effective than compression alone.

For HEIF files from mobile devices that are still too large after conversion and compression, check whether the camera's original resolution is much higher than necessary. Many modern phones capture at 12 or 48 megapixels. For web use, 2 megapixels — roughly 1920x1080 — is typically sufficient. Resizing to appropriate dimensions first makes everything downstream faster and smaller.

Validate compressed output for its delivery context #

Test compressed images in the context where they will actually appear, not just in an image viewer. A photo that looks fine in a preview app may look soft when embedded in a web page and viewed at a specific display size. Open a test version of the page with the compressed image and check it at both desktop and mobile viewport sizes before publishing.

For images in documents — PDFs, presentations — use print preview after embedding the compressed images. Compression artifacts that are invisible on screen can become apparent in printed output, especially for images containing text or fine detail. Test at the print size and quality level before finalizing a document that will be printed.

For email newsletters, send a test to yourself and check images in both the preview pane and the full-view email on mobile. Email clients apply their own rendering and sometimes add compression to inline images. Testing in the actual delivery context ensures you are evaluating what recipients will see, not what you see in the source editor.

Keep a record of the compression settings you used for each project or asset type. A simple note — 'product photos compressed at 80 quality, max 800px' — makes it easy to reproduce consistent results for future batches and gives context when someone asks why a specific file is a particular size.

FAQ

Quick answers for common edge cases.

Should I compress PNG screenshots aggressively?
No. PNG uses lossless compression, so the quality level setting does not affect visual quality the way it does in JPG. For screenshots with text or sharp UI elements, PNG is actually the better format choice than JPG because JPG compression creates artifacts around hard edges. If file size is a concern for PNG screenshots, crop unused areas, reduce pixel dimensions, or convert to WEBP.
Can I compress HEIF files from my iPhone?
Yes, HEIF compression is supported. HEIF files from modern iPhones are already efficiently compressed by the camera, so additional compression often gives modest results. For the best outcome, convert to WEBP or JPG first and then apply moderate compression. This gives a format with wider compatibility and typically better size reduction than compressing HEIF directly.
How do I keep quality high while reducing file size?
The most effective approach is to crop and resize first, then apply moderate compression. Removing unused pixels is more effective than reducing quality. For photographs, a quality setting of 75 to 85 in JPG or WEBP produces files that look identical to 100 quality at normal viewing sizes but are significantly smaller. Validate at full zoom before finalizing.
Is it worth compressing images before creating PDFs?
Yes. Images embedded in PDFs are the primary driver of large PDF file sizes. Compressing images to appropriate sizes before embedding reduces the final PDF size substantially. A PDF made from images optimized to 150 DPI for screen viewing will be much smaller than one made from full-resolution originals, with no visible difference at normal reading sizes.
What quality setting should I use for web images?
For photographs on the web, a quality setting between 75 and 85 in JPG or WEBP is the standard range. At 80 quality, most images are visually indistinguishable from 100 quality when viewed at typical screen sizes, but file sizes are 60 to 70 percent smaller. For images with sharp graphics or text, use 85 or higher to avoid artifacts, or switch to PNG for lossless quality.

Related guides

Continue with adjacent workflows.

Support via UPI

Scan this QR to support Codes of Hex.

UPI QR