How to Compress, Resize, and Convert Images Without Losing Quality
Why an image file is bigger than it needs to be
A photo straight from a modern phone is usually several megabytes. That is fine in your gallery, but it becomes a problem the moment you attach it to an email, upload it to a form with a size limit, or put it on a web page where every visitor has to download it. Most of the time the file is large for reasons that have nothing to do with how good it looks on screen: it has far more pixels than the place it will be shown, it is stored in a format that suits a different kind of picture, or it was saved at a quality level nobody can tell apart from a slightly lower one.
The good news is that each of those causes has a specific fix. This guide explains what actually determines an image's file size, how to choose between JPEG, PNG, WebP, and AVIF, how to pick a quality setting with your eyes rather than by guessing, and how to resize and crop for real destinations such as websites, social media, and favicons. The examples use the free VioApps Image Compressor & Converter, which does all of this in your browser without uploading the image anywhere, but the principles apply to any editor.
Pixels and bytes: the two meanings of "image size"
People say "make the image smaller" and mean two different things. The first is dimensions: how many pixels wide and tall the image is, such as 4032 × 3024. The second is file size: how many bytes the file takes on disk, such as 3.2 MB. They are related, but they are not the same, and confusing them is the source of most bad results.
Dimensions set the amount of raw information. A 4032 × 3024 photo, a common size for a 12-megapixel phone camera, contains 12,192,768 pixels. Each pixel needs three bytes for red, green, and blue, so the raw picture is 36,578,304 bytes — about 36.6 MB. That is exactly what you get if you save it as an uncompressed 24-bit BMP. The same photo saved by the phone as a JPEG is usually somewhere between 2 and 5 MB, because the format compresses that raw data.
This gives you two independent levers:
- Reduce the pixels by resizing or cropping. Pixel count falls with the square of the scale: halving both width and height leaves only a quarter of the pixels.
- Store the pixels more efficiently by choosing a better format or a lower quality setting. This changes how the pixels are encoded, not how many there are.
Resizing is usually the most powerful lever and the one people skip. If a photo will be displayed 1200 pixels wide, no quality setting will make a 4032-pixel-wide version as small as simply resizing it to the size it will actually be shown.
A worked example: preparing a phone photo for a website
Suppose you have a 4032 × 3024 JPEG and you want it on a blog page whose content column is 800 CSS pixels wide.
- Decide the target width. Many phones and laptops have high-density screens that draw two device pixels for every CSS pixel. To look sharp there, export at twice the display width: 1600 pixels.
- Keep the aspect ratio. The photo is 4:3, so the height is 3024 × 1600 ÷ 4032 = 1200 pixels. With the aspect ratio locked, the tool calculates this for you when you type the width.
- Check the effect. 1600 × 1200 is 1,920,000 pixels, about 16% of the original 12.2 million. Before any compression, you have already removed roughly 84% of the data.
- Choose the format and quality. For a photograph, WebP or JPEG at a quality around 75–85% is a sensible starting point. Compare the result with the original and lower the quality only while you cannot see a difference.
The combination of the right dimensions and a sensible quality setting routinely turns a multi-megabyte photo into a file of a few hundred kilobytes that looks the same on the page. The exact figure depends heavily on the content: a smooth sky compresses far better than a photo of gravel or foliage, which is why it is worth checking the real output size rather than relying on a rule of thumb.
Lossy and lossless compression
Every format in this guide compresses the pixel data, but in one of two ways.
Lossless compression, used by PNG, finds patterns in the data and stores them more compactly, the way a ZIP file does. Decoding gives back every pixel exactly. It works extremely well on images with large flat areas and repeated colors — screenshots, diagrams, logos, interface graphics — and poorly on photographs, where almost every pixel differs slightly from its neighbors because of natural texture and sensor noise.
Lossy compression, used by JPEG and by WebP and AVIF in their usual mode, goes further by discarding detail the eye is unlikely to notice. JPEG, for example, processes the image in small blocks, keeps the broad changes in brightness and color, and stores fine detail more coarsely. It also typically records color at a lower resolution than brightness, because human vision is much more sensitive to changes in light than in hue. The quality setting controls how aggressively detail is discarded. The trade-off is excellent for photographs and visibly worse for sharp-edged text and line art.
Two consequences follow. First, a lossy file never contains more detail than it did before it was saved, so converting a JPEG to PNG does not restore anything — it only stops further loss while making the file larger. Second, every time you open a lossy file, edit it, and save it as lossy again, a little more is discarded. This is called generation loss. Keep your original and always export from it instead of repeatedly re-saving the same JPEG.
Choosing a format: JPEG, PNG, WebP, AVIF, and the rest
The right format depends on what is in the picture and where it is going. This table summarizes the practical differences.
| Format | Compression | Transparency | Best for | Watch out for |
|---|---|---|---|---|
| JPEG | Lossy | No | Photos that must open anywhere: email, documents, older software, print services | Halos around text and sharp edges; cannot be transparent |
| PNG | Lossless | Yes | Screenshots, logos, diagrams, graphics with text, images needing transparency | Photos become very large |
| WebP | Lossy or lossless | Yes | Photos and graphics on websites; smaller files at similar quality | Some older desktop apps and upload forms still reject it |
| AVIF | Lossy or lossless | Yes | Web images where the smallest possible file matters | Few browsers can create it; older software cannot open it |
| GIF | Lossless, max. 256 colors | On/off only | Simple animations | Photos lose color and show banding |
| BMP | None | Not in common use | Legacy software that requires it | Enormous files |
| ICO | Container (often PNG inside) | Yes | Website favicons and Windows icons | Not a general-purpose image format |
A simple decision path
- Is it a photograph? Use WebP for the web if your site and audience support it, or JPEG when the file has to work everywhere. Google's published comparison found lossy WebP files to be roughly 25–34% smaller than JPEG files of equivalent measured quality, though the saving for any single image varies.
- Does it contain text, sharp lines, or flat colors? Use PNG, or lossless WebP where supported. JPEG tends to put faint ripples around letters and edges.
- Does it need a transparent background? Use PNG or WebP. JPEG cannot store transparency at all.
- Is it a favicon? Use ICO for the classic
favicon.ico, which can hold several sizes in one file.
AVIF, based on the AV1 video codec, often produces the smallest files of all and can be displayed by current versions of the major browsers. Creating AVIF directly in a browser is still uncommon, so the VioApps tool only offers it where your browser can actually encode it, and shows it as unavailable otherwise. The same check applies to WebP, which Chromium-based browsers and Firefox can encode.
How to pick a quality setting
The quality slider on lossy formats is not a percentage of anything measurable; it is an instruction to the encoder about how much detail to keep. Two practical facts matter more than the number itself.
First, the scale is not standardized. Quality 80 in one program is not the same as quality 80 in another, and the same number means different things for JPEG and WebP. Treat a number as a starting point, not a specification.
Second, the relationship is not linear. Moving from 100 down to around 85 usually shrinks the file substantially with no visible change, while further reductions save progressively less and start to show artifacts. Near the very bottom of the scale the image degrades quickly for little additional saving.
A reliable method is to judge by eye:
- Start at about 80 for photos.
- Compare the original and result side by side at the size the image will really be displayed.
- Look at the places where compression shows first: smooth gradients such as skies and skin (banding), edges of text and thin lines (ringing or halos), and fine textures such as hair, grass, or fabric (smearing or blockiness).
- Lower the quality in small steps until you notice a difference, then step back up.
Always check the actual output size. An image that was already heavily compressed can come out larger after re-encoding at a high quality, and converting a photo to PNG or BMP almost always makes it larger. A trustworthy tool reports this plainly; the VioApps compressor highlights the size change and tells you when the result is bigger than the original.
Resizing correctly
Keep the aspect ratio unless you mean to change it
The aspect ratio is the relationship between width and height. If you change one dimension without the other, the picture is stretched or squashed, which is immediately obvious on faces and circles. With the aspect ratio locked, entering a new width calculates the matching height automatically. When you genuinely need a different shape — a square from a landscape photo, for example — crop to that shape instead of stretching. The tool's "crop to fill" option does this from the center, while the Crop & Rotate tab lets you choose exactly which part to keep.
Common target sizes
- 1920 × 1080 (16:9): full HD screens, presentation slides, and wide website banners.
- 1280 × 720 (16:9): HD, and the size widely recommended for video thumbnails.
- 1080 × 1080 (1:1): square social media posts.
- 1080 × 1350 (4:5): portrait social posts, which take up more of a phone screen in a feed.
- 1080 × 1920 (9:16): full-screen vertical stories and short videos.
Platforms adjust their recommendations from time to time, so treat these as current conventions rather than permanent rules. With the aspect ratio locked, the tool's presets fit your image inside the chosen box without distorting it; unlock the ratio to get the exact preset size.
Shrinking is safe; enlarging cannot add detail
Reducing an image averages groups of pixels into fewer pixels, and done well it can even look sharper because noise is averaged away. Very large reductions are best done in several halving steps rather than one jump, which avoids the jagged, shimmering look of a single crude resample; the VioApps tool does this automatically. Enlarging is different: the software has to invent the in-between pixels by interpolation, so the result is softer, never more detailed. If you need a large image, start from the largest original you have.
Cropping and rotating
Cropping is the most underrated way to reduce file size, because it removes pixels you did not want in the first place. It also improves composition: trimming empty space around a subject usually makes a picture stronger. Choosing a fixed ratio while cropping guarantees the result fits its destination — 1:1 for a profile photo or square post, 16:9 for a video thumbnail or slide, 9:16 for a story, 3:2 or 4:3 to match common camera and phone sensors.
Do the crop before you set a final size. Cropping changes the starting dimensions, so a size chosen beforehand no longer describes the same picture. The VioApps tool resets a custom size when you apply a new crop for exactly this reason and tells you it has done so.
Rotating by 90° and flipping simply move pixels to new positions without blending them, so these steps do not soften the image themselves. Saving the result as a lossy format still re-encodes it, though, so the quality guidance above still applies.
Phone photos add one complication. Cameras often save the pixels in the sensor's natural orientation and add a small note, called the EXIF orientation tag, telling viewers to rotate the picture for display. Software that ignores the tag shows the photo sideways. The VioApps tool applies the orientation to the pixels when it opens the file, so what you edit and download is the right way up and no longer depends on the tag.
Transparency and background colors
A transparent image stores an extra value for each pixel, called alpha, that says how see-through it is. Logos and cut-out product photos rely on this so they can sit on any background. PNG, WebP, AVIF, and ICO keep alpha; JPEG and BMP do not.
When you convert a transparent image to JPEG, every transparent pixel has to become some solid color. Choose the color of the background where the image will be placed. This matters more than it seems, because the edges of a well-made logo are partly transparent so they blend smoothly. If you fill them with white and then place the JPEG on a dark page, a pale outline appears around the shape. The tool shows a background color picker whenever the chosen format cannot store transparency, so you can match the destination before downloading. If you need the image to work on many backgrounds, keep it as PNG or WebP instead.
Ready-made recipes
A photo for a website or blog
- Crop away anything that does not support the point of the image.
- Resize to twice the width it will be displayed at, for example 1600 pixels for an 800-pixel column.
- Convert to WebP, or JPEG if your platform does not accept WebP.
- Set the quality around 75–85% and compare before downloading.
Photos for an email attachment
Many email services cap a message at roughly 20–25 MB, and attachments are encoded in transit in a way that adds about a third to their size, so the practical limit is lower than it sounds. Resizing each photo to around 1600–2048 pixels on the long side and saving as JPEG at about 80% keeps it perfectly viewable on any screen at a fraction of the original size. Use JPEG rather than WebP here, since the recipient's software may not open WebP.
A square profile picture or social post
- In Crop & Rotate, choose 1:1 and position the box over the subject.
- Apply the crop, then resize to 1080 × 1080.
- Save as JPEG or WebP at about 85%; social platforms re-compress uploads, so starting from a clean, high-quality file gives the best final result.
A favicon for a website
- Start from a square, simple logo with a transparent background; fine detail disappears at 16 pixels.
- Choose ICO in the Convert tab and keep the 16, 32, and 48 pixel sizes, which cover browser tabs, bookmarks, and Windows shortcuts. Adding 256 helps on high-resolution Windows displays.
- Save the file as
favicon.icoin the root of your site. Modern sites usually also provide a 180 × 180 PNG for Apple devices and 192 and 512 pixel PNGs for installable web apps, which you can export from the same logo as PNG.
A screenshot for documentation or support
Crop to the relevant window or region, keep it as PNG so text stays crisp, and resize only if the screenshot is much larger than it will be displayed. If the file must be smaller, lossless WebP usually beats PNG; a lossy format is acceptable only if you check that small text remains readable.
Privacy and metadata
Photos often carry hidden information: the camera or phone model, the date and time, editing software, and sometimes the GPS coordinates of where the picture was taken. Sharing the original file can reveal more than you intended, such as the location of your home. Images exported by the VioApps tool are re-encoded from the pixels alone, so this metadata is not copied into the downloaded file.
Where processing happens matters too. Many online compressors upload your image to a server, process it there, and send it back. The VioApps tool decodes, edits, and encodes the image inside your browser using the built-in canvas features, so the file itself never leaves your device. That makes it suitable for personal photos, identity documents you need to shrink for an application form, and unpublished work.
One technical note: browsers output images in the standard sRGB color space. Photos captured in a wider color space, which some recent phones use, can look very slightly less saturated after conversion. For everyday web and sharing use the difference is rarely noticeable.
Common mistakes to avoid
- Compressing instead of resizing. Pushing quality very low on a huge image gives an ugly result that is still too large. Resize to the display size first.
- Re-saving the same JPEG repeatedly. Each save loses a little more. Keep the original and export a fresh copy each time.
- Using JPEG for screenshots and logos. Text and sharp edges pick up visible artifacts. PNG or WebP is the better fit.
- Using PNG for photographs. The file can easily be several times larger than a JPEG or WebP that looks identical.
- Stretching to change the shape. Crop to the new aspect ratio instead of distorting the image.
- Enlarging a small image and expecting detail. Upscaling only makes it softer and larger.
- Converting a transparent logo to JPEG with the wrong background. Match the background color of the destination, or keep transparency with PNG or WebP.
- Trusting a quality number instead of your eyes. Compare the result at its real display size and read the actual file size.
Putting it together
Reducing an image's file size well is mostly a matter of doing things in the right order: crop to what matters, resize to the size it will really be shown, choose the format that suits the content, and then set a quality that you cannot tell apart from the original. Each step is simple on its own, and together they usually shrink a file dramatically without any visible loss.
The Image Compressor & Converter puts all four steps in one place, combines them into a single download, and always shows the real output size so you can make the call yourself.
Try the Image Compressor & ConverterRelated Resources
Continue with more practical tools and guides:
- Compress, resize, convert, crop, and rotate images in your browser
- Extract text from an image with the Image to Text Converter
- Read how to prepare images for better OCR results
- Browse all VioApps guides
- Read our editorial and quality approach
Editorial note: This guide is maintained by the VioApps team and updated when tool behavior, browser support, or best practices change.