How to Compress an Image: JPG, PNG, GIF, Email and Web Guide
A photo straight from a phone camera is often several megabytes. That is fine in your gallery, but it can be too big for an email, an upload form or a page that needs to load quickly. This guide shows how to compress an image step by step, then covers what changes with each format and destination: JPG, PNG, GIF, email attachments and website images.
Jump to the part you need:
- Compress a JPG: quality settings and built-in tools on Windows, Mac and phones.
- Compress a PNG: smaller files without losing transparency.
- Compress a GIF: fewer frames and colors, or a switch to video.
- Compress photos for email: attachment limits for Gmail, Outlook.com, Yahoo and iCloud.
- Compress images for a website: size targets, WebP, responsive images and lazy loading.
- Need an exact file size for an exam or job form? See How to Resize Image to 20KB.
Related: How to Resize an Image Without Losing Quality.
Related: How to Convert WebP to JPG.
Lossy vs Lossless Compression
Every image compressor uses one of two approaches, or a mix of both:
- Lossless (PNG, lossless WebP): the file gets smaller but every pixel stays exactly the same. The savings are usually modest.
- Lossy (JPG, lossy WebP): some detail that the eye is unlikely to notice is discarded, such as subtle gradients and fine texture in busy areas. The savings are usually much larger.
For photos that will be viewed on a screen, lossy compression is almost always the right choice. For screenshots, logos and graphics with sharp text, lossless keeps edges crisp.
Pick the Right Format First
| Format | Type | Best for | Watch out for |
|---|---|---|---|
| JPG | Lossy | Photos, complex images | No transparency; quality drops with each resave |
| PNG | Lossless | Screenshots, text, logos, transparency | Large files for photos |
| WebP | Lossy or lossless | Web images, including ones with transparency | Some older software and upload forms do not accept it |
| GIF | Lossless, 256 colors | Short animations, chats | Large files for anything longer than a few seconds |
| SVG | Vector | Icons, logos, illustrations | Not for photos |
Google’s guide to choosing image formats gives the same rule: match the format to the content, and prefer modern formats such as WebP on the web. Google’s own WebP documentation reports that lossy WebP files are 25 to 34% smaller than comparable JPEGs and lossless WebP files are 26% smaller than PNGs in its tests. Your results will vary with the image. If your file is in the wrong format, the convert image tool switches it in the browser.

How to Compress an Image Step by Step
This method works for almost any photo. It uses the free image compressor, which runs in your browser, so your photos are not uploaded to a server.
- Keep the original. Work on a copy so you can start again if the result looks too soft.
- Resize to the display size. A 4,000-pixel-wide photo shown in a 1,200-pixel slot has about 91% more pixels than anyone will see. Use the resize image tool first. Resizing often saves more than compression alone.
- Choose the format. JPG or WebP for photos; PNG for screenshots and graphics that need transparency.
- Compress. Open the image compressor, add your image and set the quality. For JPG and WebP photos, 75 to 85 is a sensible starting range. Start at 80 and adjust.
- Check the result. Open the new file at full size. Look at faces, small text and sharp edges, and confirm the file size meets your limit.
If the file is still too big, lower the quality a little or reduce the dimensions further. Go back to the original each time rather than compressing the compressed copy again.
Strip Metadata
Photos carry EXIF data such as the camera model, the date and sometimes the GPS location. Many compressors remove it. The saving is usually small, but removing location data is a sensible privacy step before you share a photo publicly.
Avoid the Generation-Loss Trap
Every lossy save discards more data, so compressing a JPG that was already compressed makes the damage build up. Always start from the original file and keep a master copy untouched. Compress only the copies you publish or send.
When Not to Compress
- Print work: keep quality at 90 to 100; print shows flaws that screens hide.
- Archival masters: store originals at full quality; storage is cheap, but lost detail cannot be recovered.
- Images with sharp text: keep screenshots and interface graphics as PNG, because lossy compression blurs edges.
How to Compress a JPG
JPG and JPEG are the same format. JPEG stands for Joint Photographic Experts Group, the committee behind the standard, and .jpg and .jpeg are just two spellings of the file extension. If a form asks for a JPEG, a .jpg file will usually work, but check its size and dimension rules too.
JPG is lossy, so the quality setting does most of the work. Use these as starting points:
| JPG quality | Likely file size | Visual result | Suitable use |
|---|---|---|---|
| 90 to 100 | Often larger | Keeps more detail | High-quality exports and some print needs |
| 80 to 85 | Often moderate | Usually good for everyday sharing | Websites, email and general uploads |
| 60 to 75 | Often smaller | May show some softness | Smaller web images and size-limited forms |
| Below 60 | Can be very small | Higher risk of visible artifacts | Only when a strict size limit requires it |
These ranges are guidelines, not fixed rules. A simple photo may stay clear at a lower setting, while a detailed one may need a higher setting. Use the highest quality that still meets your file-size need.
Built-in Tools You Already Have
- Windows (Paint): open the image, choose Resize, enter smaller pixel dimensions, then save a copy as JPEG and check the file size.
- Mac (Preview): choose Tools, then Adjust Size, enter the dimensions you need, then export a copy as JPEG and check the size and quality.
- Phone (Google Photos): tap Edit, crop away extra space around the subject, save a copy, then run the copy through a compressor if it is still too big.
Paint and Preview are good for resizing, but their compression controls are limited. If you need to hit a specific file size, use a compressor with a quality setting.
PNG photo? Saving a photo that is stored as PNG as a JPG often makes it much smaller. JPG has no transparency, though, so transparent areas turn into a solid background. Keep logos and icons with transparent backgrounds as PNG or WebP.

How to Compress a PNG Without Losing Transparency
PNG is lossless, so a quality slider has no effect on a normal PNG. Its size comes from three things: the dimensions, the number of colors, and transparency data. These are the ways to bring it down:
- Reduce the dimensions. A 2,000 × 1,000 pixel image holds four times the pixels of a 1,000 × 500 image. A small website logo rarely needs to be 2,000 pixels wide.
- Try PNG-8. PNG-8 uses a palette of up to 256 colors, while PNG-24 supports millions. Simple logos, icons and flat illustrations often look the same in PNG-8 and the file is smaller. In an editor, look for an export option called PNG-8 or indexed color.
- Run a lossless optimizer. These tools re-save the file more efficiently without changing a single pixel. The saving depends on the image, and a PNG that is already optimized may barely change.
- Remove metadata. Software names, timestamps and text chunks can be stripped. This usually saves less than resizing.
- Change the format when it makes sense. If a photo is saved as PNG and does not need transparency, JPG is usually far smaller. If you need transparency and a smaller file, WebP supports both.
| Feature | PNG-8 | PNG-24 |
|---|---|---|
| Colors | Up to 256 | Millions |
| Transparency | Palette-based; soft edges can look rough | Smooth, partial transparency |
| File size | Often smaller | Often larger |
| Best for | Icons, simple logos, flat graphics | Detailed graphics, soft shadows, glows |
If your logo has soft shadows, glow effects or fading edges, compare the PNG-8 version carefully and switch back to PNG-24 if the edges look jagged. After any change, preview the image on both a light and a dark background to make sure the transparent areas still behave as expected.

How to Compress a GIF Without Losing the Animation
An animated GIF stores every frame as a separate image, with up to 256 colors per frame. A 3-second clip at 10 frames per second already holds 30 frames. That is why a short GIF can be bigger than a video of the same clip. Three things drive the size: the number of frames, the dimensions and the number of colors.
- Cut extra frames. In an editor with a frame timeline, remove duplicate frames and long pauses. Cutting too many makes the movement look jerky.
- Lower the frame rate in small steps. Simple reaction GIFs often look fine at a lower rate; fast movement needs more frames to stay smooth.
- Reduce the dimensions. An 800 × 400 GIF holds four times the pixels of a 400 × 200 one, and the saving applies to every frame. A chat reaction rarely needs to be 800 pixels wide.
- Reduce the colors. Try 128 colors instead of 256 and preview. Cartoons and simple logos may work with 64. Stop when you see color banding or rough edges.
- Use mild lossy GIF compression. Many GIF tools have a lossy slider. Start low and watch for noise around edges, blurry text and lost detail.
Switch format when you can. Google’s web.dev guide recommends replacing animated GIFs with video on web pages, because video formats compress motion much more efficiently. MP4 normally has no transparent background, so use animated WebP if you need transparency and your destination supports it. Keep GIF for chats and platforms that expect it.
| Format | File size | Transparency | Best use |
|---|---|---|---|
| GIF | Often large | Yes | Chats and broad compatibility |
| MP4 video | Often much smaller | Usually no | Websites and social posts |
| Animated WebP | Often smaller than GIF | Yes | Websites and apps that support it |
After any change, play the whole animation and check the motion, the loop and the colors, not just the first frame.

How to Compress Photos for Email
Email providers limit the size of each message. The limit applies to all attachments together, not to each photo. These are the limits stated on each provider’s help pages (checked October 2026):
| Provider | Limit per message | If your photos are too large |
|---|---|---|
| Gmail (personal) | 25 MB of attachments | Gmail removes the attachment and adds it as a Google Drive link |
| Outlook.com | 25 MB, including the text and all attached files | Share the files from OneDrive instead |
| Yahoo Mail | 25 MB for all attachments combined | Split the photos across emails or share a link |
| iCloud Mail | 20 MB (up to 5 GB with Mail Drop turned on) | Use Mail Drop; recipients have 30 days to download |
Work and school accounts can have different limits set by the administrator, so check with your IT team if a business email fails. Providers can also change these limits, so check the help page if a message is rejected.
Leave some headroom. Attachments are usually sent using Base64 encoding, which makes the data roughly a third larger. For example, 18 MB of photos can become about 24 MB in transit, which is very close to a 25 MB limit.
- Resize first. A width of around 1,600 pixels is plenty for viewing on screen; 1,200 pixels is enough for smaller images. Keep the full size only if the recipient will print the photos.
- Save as JPG at quality 80 to 85. This usually keeps everyday photos clear on screen. Keep screenshots and graphics as PNG.
- Compress all the photos together in the image compressor, then check their combined size. Ten photos at 2 MB each already total 20 MB before encoding.
- Aim below the limit. For a 25 MB limit, around 18 MB of photos or less is a practical target; for a 20 MB limit, around 14 MB. These are estimates, not guarantees.
- Split or share a link if needed. Send the photos across two emails, or upload them to Google Drive, OneDrive or iCloud and email the link. A link is the better choice when someone needs full-resolution originals.
ZIP is not compression for photos. A ZIP file bundles several files into one, but JPG images are already compressed, so zipping them saves very little. Compress the photos first, then ZIP them if you want to send one tidy file.

How to Compress Images for a Website
Images are often a large part of a page’s total size, so they are one of the first things to fix when a site loads slowly. Start by matching each image to the space it fills. These widths are common starting points:
| Image placement | Suggested width |
|---|---|
| Hero or banner image | 1,600 to 1,920 pixels |
| Blog content image | 800 to 1,200 pixels |
| Card or thumbnail | 300 to 600 pixels |
| Logo | Match the display size and the resolution you need |
These are guidelines, not requirements. Your theme’s column width and high-density screens can change what looks sharp, so check the actual display size on your pages.
- Compress before uploading. WordPress creates several smaller sizes of each upload, but it keeps your original file too. Uploading an already resized and compressed version saves storage and lowers the risk of a huge file being served. Use the resize image tool and then the image compressor.
- Use an efficient format. WebP is a practical default for photos and graphics. AVIF can produce even smaller files and is worth testing with your setup. Keep JPG as a fallback and PNG for graphics that need its features.
- Set quality around 75 to 85 for JPG and WebP photos, then compare with the original at the size it will be displayed. Saving everything at 100 creates large files that look almost the same on screen.
- Serve responsive sizes. The
srcsetandsizesattributes let a phone download a smaller file than a desktop. WordPress adds this markup to images in posts. To check, right-click an image, choose Inspect and look forsrcset. - Lazy-load images below the first screen. The
loading="lazy"attribute delays offscreen images until the visitor scrolls near them, and recent WordPress versions add it automatically. Do not lazy-load the main hero image: it is often the Largest Contentful Paint (LCP) element, and delaying it can make the page feel slower, as Google explains in its article on the effects of too much lazy loading. - Measure, then fix the biggest files. Run the page through Google PageSpeed Insights and read the image recommendations: images larger than their display size, images that could use a modern format, images that could be compressed further, and offscreen images loading too early. Fix the largest files first and test again on both mobile and desktop.
Smaller images do not guarantee a fast page on their own. Server response time, scripts, fonts and caching also matter, but images are usually the easiest place to start.

Frequently Asked Questions
Does compressing an image reduce its dimensions?
No. Compression reduces the file size only, so a 1920 × 1080 image stays 1920 × 1080. To change the width and height, resize the image separately, ideally before you compress it.
Why is my PNG still large after compression?
PNG is lossless, so quality sliders do not apply to it. Reduce its dimensions, try PNG-8 if it is a simple graphic, or convert it to JPG or WebP if it is a photo. See the PNG section above.
What quality setting should I use for JPG or WebP?
Start at 80. For most everyday photos, 75 to 85 keeps the image clear on screen while cutting the file size. Go higher for print or detailed images, and only go below 60 when a strict size limit forces it.
What is the attachment limit for Gmail and Outlook.com?
Personal Gmail accounts allow 25 MB of attachments per email, and larger files are added as a Google Drive link. Outlook.com allows 25 MB per email, including the message text. Leave headroom, because encoding makes attachments larger in transit.
Is a GIF or a video smaller?
For the same animation, a video file is usually much smaller, because video formats reuse data between frames. The exact result depends on the content and the encoding settings.
Is it safe to compress images online?
With a browser-based tool, the file is processed on your own device and is not uploaded to a server. Avoid uploading sensitive photos to server-side compressors you do not trust.
Final Thoughts
Image compression is a short routine rather than one perfect setting: keep the original, resize to the size you need, pick the right format, compress at around 75 to 85, and check the result. The format and destination sections above cover the details for JPG, PNG, GIF, email and websites.
Try it now: use the free compress image tool to shrink your file in the browser. If it is still too large, start with the resize image tool.
Sources
Format and web guidance: Choose the right image format (web.dev), WebP documentation (Google for Developers), Optimize images (PageSpeed Insights), Replace animated GIFs with video and The performance effects of too much lazy loading (web.dev), and the JPEG committee site. Email limits: Gmail Help, Outlook.com support, Yahoo Help and Apple Support.
Free tools for this
Everything runs in your browser. Your files never leave your device.