Image Guides

How to Compress an Image: JPG, PNG, GIF, Email and Web Guide

Published 15 October 2026 · By the AI Mode Team

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:

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:

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

FormatTypeBest forWatch out for
JPGLossyPhotos, complex imagesNo transparency; quality drops with each resave
PNGLosslessScreenshots, text, logos, transparencyLarge files for photos
WebPLossy or losslessWeb images, including ones with transparencySome older software and upload forms do not accept it
GIFLossless, 256 colorsShort animations, chatsLarge files for anything longer than a few seconds
SVGVectorIcons, logos, illustrationsNot 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

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.

  1. Keep the original. Work on a copy so you can start again if the result looks too soft.
  2. 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.
  3. Choose the format. JPG or WebP for photos; PNG for screenshots and graphics that need transparency.
  4. 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.
  5. 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

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 qualityLikely file sizeVisual resultSuitable use
90 to 100Often largerKeeps more detailHigh-quality exports and some print needs
80 to 85Often moderateUsually good for everyday sharingWebsites, email and general uploads
60 to 75Often smallerMay show some softnessSmaller web images and size-limited forms
Below 60Can be very smallHigher risk of visible artifactsOnly 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

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.

 Compress JPG

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:

FeaturePNG-8PNG-24
ColorsUp to 256Millions
TransparencyPalette-based; soft edges can look roughSmooth, partial transparency
File sizeOften smallerOften larger
Best forIcons, simple logos, flat graphicsDetailed 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.

compress png

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.

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.

FormatFile sizeTransparencyBest use
GIFOften largeYesChats and broad compatibility
MP4 videoOften much smallerUsually noWebsites and social posts
Animated WebPOften smaller than GIFYesWebsites 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.

compress gif

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):

ProviderLimit per messageIf your photos are too large
Gmail (personal)25 MB of attachmentsGmail removes the attachment and adds it as a Google Drive link
Outlook.com25 MB, including the text and all attached filesShare the files from OneDrive instead
Yahoo Mail25 MB for all attachments combinedSplit the photos across emails or share a link
iCloud Mail20 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.

  1. 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.
  2. Save as JPG at quality 80 to 85. This usually keeps everyday photos clear on screen. Keep screenshots and graphics as PNG.
  3. 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.
  4. 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.
  5. 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.

compress photos for email

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 placementSuggested width
Hero or banner image1,600 to 1,920 pixels
Blog content image800 to 1,200 pixels
Card or thumbnail300 to 600 pixels
LogoMatch 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.

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.

compress images for website

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.

More Image Guides

Leave a Reply

Your email address will not be published. Required fields are marked *