PixThru

Image compression explained: JPG, PNG, WebP, and how to hit an exact file size

Why a photo is 4 MB, what actually makes it smaller, the real differences between JPG, PNG and WebP, and how to get a file under 100 KB or 200 KB for a form without it turning to mush.

By Luiz Mueller · · 5 min read

A photo from a current phone is twelve million pixels and three to five megabytes. A job portal wants it under 200 KB. A visa site wants under 100 KB. An email with ten of them attached bounces. Image compression is how you close that gap, and once you understand the three things that decide a file's size, the settings on any tool stop being guesswork.

What makes an image file big

Pixels. The number of pixels is the base cost. A 4000 × 3000 photo has twelve million of them; the same photo at 1600 × 1200 has under two million, roughly a sixth of the data before any compression at all. Most images are viewed on screens that are between 400 and 2000 pixels wide, so the extra pixels in a phone photo are invisible almost everywhere they are sent.

Format and quality. JPG and WebP are lossy: they throw away detail the eye is bad at noticing, and a quality setting decides how much. The difference between quality 95 and quality 80 is usually invisible on a photo and halves the file. Below about 60 the loss starts to show as blockiness in smooth areas and halos around edges. PNG is lossless: every pixel is kept exactly, which is right for screenshots, logos and anything with text, and wasteful for photos, where a PNG can be five to ten times the size of a JPG that looks identical.

Content. A photo of a clear sky compresses to almost nothing; a photo of gravel or foliage fights the encoder because every pixel is different from its neighbour. Two photos with the same pixel count and quality setting can differ in size by a factor of four. This is why "quality 80" never means a predictable number of kilobytes.

JPG, PNG or WebP

JPGPNGWebP
Best forPhotosScreenshots, logos, text, graphicsBoth, on the web
TransparencyNoYesYes
Size for a photoSmallVery largeSmallest (about 25 to 30% below JPG at similar quality)
Opens everywhereYesYesBrowsers and recent apps; some forms and older software reject it

Two practical rules follow. If an upload form says "JPG or PNG", send a JPG for a photo and a PNG for a screenshot, and do not try WebP even though it would be smaller. And never convert a logo with a transparent background to JPG: the transparent area becomes solid white or black, because JPG has no way to store transparency. The image converter handles the format change; the compressor keeps whichever format you give it.

Hitting an exact size

Forms do not ask for "quality 80"; they ask for "under 100 KB". Because content decides the size, the only reliable way to meet a limit is to search for it: try a quality setting, measure the result, adjust, repeat. That is what the Compress Image tool does. You type the target in kilobytes, it finds the highest quality whose file still lands under it, and only if no quality setting is small enough does it start reducing the pixel dimensions, step by step, so that the picture keeps as much sharpness as the budget allows. If the file was already under the target, it tells you and leaves the original alone rather than re-saving it for nothing.

For the targets that come up most, there are dedicated pages: 100 KB, 200 KB, 50 KB and 1 MB, with the same tool preset to that number. Pick a target a little under the limit the form states; a file at 199 KB is fine, but some portals measure in different units and a few kilobytes of margin avoids an argument with a validator.

What a kilobyte target looks like

A rough feel for what fits, for an ordinary photo of a person:

  • 1 MB: full phone resolution at a visibly perfect quality. Nothing is lost that you could see.
  • 300 KB: about 2000 pixels wide, good quality. Fine for a website or full-screen viewing.
  • 100 KB: around 1000 to 1200 pixels wide. Sharp as a profile or ID photo, soft if blown up to full screen.
  • 50 KB: around 600 to 800 pixels wide. Acceptable for a thumbnail or a form; visibly compressed at any larger size.
  • 20 KB and below: small and noticeably soft. Crop tightly first so the kilobytes are spent on the subject and not on the wall behind it.

Resize first when you can

If you know the image will be displayed at a fixed size, resizing to that size before compressing gives a much better result than compressing a huge image down to the same kilobytes. A 1080 × 1080 Instagram post squeezed into 150 KB looks crisp; a 4000 × 4000 original squeezed into 150 KB looks terrible, because the encoder has to butcher sixteen times as many pixels. The resize tool sets exact pixel dimensions, and the compressor does the rest.

The hidden kilobytes: metadata

Phone photos carry a block of metadata: camera model, settings, the time, often the GPS location, and sometimes an embedded thumbnail. It is usually 10 to 60 KB, which does not matter in a 4 MB photo and matters a lot in a 50 KB one. Compressing re-encodes the image and drops that block, which is why a compressed file is also a cleaner one to share. If you want to see what was in there first, or strip it without compressing, the EXIF viewer shows and removes it.

Many files at once

For a folder of photos, the bulk compressor takes up to 50 at a time and returns a ZIP. The batch limit is about your browser's memory, not a plan: fifty full-resolution photos decoded at once is already a few gigabytes of pixels, and a second batch is one drag away.

Everything above runs in your browser. The image is decoded, resized and re-encoded by your own device and never uploaded, which is the right arrangement for the files people most often need to shrink: ID photos, signed forms and screenshots of bank statements.

Questions people ask

Does compressing an image reduce its quality every time?
Re-saving a JPG re-encodes it, and each pass loses a little. One or two passes are invisible; ten are not. Keep your original and compress from it each time, rather than compressing an already compressed copy.
Why is my PNG screenshot still large after compressing?
PNG is lossless, so the only things that shrink it are fewer pixels or fewer colours. A screenshot with a photo in it stays large as PNG; if transparency is not needed, converting it to JPG or WebP makes it several times smaller.
Can I compress an image without changing its dimensions?
Yes, as long as the target is achievable at those dimensions. The tool lowers quality first and only reduces pixels when no quality setting is small enough. Choose a larger target if you need the dimensions untouched.

Tools mentioned in this guide

More guides

🔒 Your files are processed on your device. Every tool linked in this guide runs in your browser; nothing is uploaded.