ScreenshotNeo

BlogHow-to

How to Compress a Screenshot to Under 2 MB

Crop, resize, choose the right format, and verify the saved file to reliably get any screenshot below 2 MB.

By the ScreenshotNeo team1 October 20267 min read

Direct answer: Keep the original file, crop away unnecessary areas, resize it proportionally, export to a suitable format, and check the saved file’s actual byte size. No single pixel dimension or quality setting guarantees a file under 2 MB because screenshots contain different amounts of text, color, transparency, and detail.

1. The reliable compression workflow

  1. Preserve the original. Work on a copy so you can restore readable text or transparency if compression goes too far.
  2. Crop first. Remove browser chrome, empty margins, and unrelated content. Fewer pixels usually gives you a better result than aggressive quality reduction.
  3. Resize proportionally. Reduce width and height together. Keep the aspect ratio locked so circles, icons, and layouts do not distort.
  4. Choose the format. Use PNG for crisp interface text, diagrams, line art, or transparency. Use JPEG when a smaller file matters more than lossless edges. WebP can also be effective when the destination accepts it.
  5. Export a new file. Do not overwrite the source while iterating.
  6. Verify the bytes. Check the exported file itself, not the source image’s dimensions or an editor’s estimate. A file shown as 2.0 MB may still exceed a service’s 2,000,000-byte limit.

2. macOS: Preview

  1. Open the screenshot in Preview.
  2. Choose Tools > Adjust Size.
  3. Enable Resample image, keep the aspect ratio locked, and enter a smaller width or height.
  4. Save a new copy and inspect its size in Finder or the upload dialog.
  5. If it is still over the limit, choose File > Export, select JPEG, and lower the quality slider. Preview also supports PNG, HEIC, TIFF, and other formats.
  6. Check the exported file again. Repeat with a smaller pixel size or lower JPEG quality until it is below the required byte limit.

Preview also supports batch image adjustment, which is useful when the same reduction must be applied to multiple screenshots.

3. Windows: Snipping Tool, Paint, and PowerToys

  1. Save the capture from Snipping Tool.
  2. Open it in Paint for a quick crop or resize. Keep proportions locked when changing dimensions.
  3. For repeated or batch work, select files in File Explorer, open the context menu, and choose PowerToys Image Resizer.
  4. Use the Fit mode when the entire screenshot must remain visible. It scales proportionally and supports PNG and JPEG encoders.
  5. Keep PNG when text, line art, or transparency remains readable and the result fits. Convert to JPEG and adjust quality when the PNG is too large.
  6. Open the output folder and verify every file’s actual size.

4. Office documents: compress the embedded picture

If the screenshot is inside Word, PowerPoint, or another Office document, select the picture and choose Picture Format > Compress Pictures. Reduce the picture resolution and remove cropped areas when that option is available. This can reduce both the embedded image and the overall document size. Save a copy, then inspect the document or exported image before uploading.

5. Command-line compression for repeatable jobs

A command-line workflow is useful for CI jobs, uploads, and folders containing many screenshots. The following ImageMagick examples resize proportionally and write a new file. Choose a maximum width that fits your use case, then verify the result.

# Resize a PNG proportionally, preserving transparency
magick input.png -resize "1600x1600>" output.png

# Convert to JPEG and set a starting quality
magick input.png -resize "1600x1600>" -background white -alpha remove -alpha off -quality 82 output.jpg

# Inspect dimensions and format
magick identify output.png
magick identify output.jpg

# Check the exact byte count on macOS/Linux
wc -c < output.png
wc -c < output.jpg

The > modifier prevents enlarging images that are already smaller than the requested box. JPEG cannot retain transparency, so choose a background color before conversion.

6. Python: resize and iterate until the file is below 2 MB

This Pillow script keeps the aspect ratio, tries PNG first when transparency exists, and otherwise writes JPEG candidates at decreasing quality values. It checks bytes after saving instead of assuming a quality value will work.

from pathlib import Path
from PIL import Image

LIMIT = 2_000_000  # change to 2 * 1024 * 1024 if your receiver uses MiB
source = Path("input.png")

with Image.open(source) as image:
    image = image.convert("RGBA") if "A" in image.getbands() else image.convert("RGB")
    # Reduce dimensions before reducing quality. Adjust this ceiling for your use case.
    image.thumbnail((2400, 2400), Image.Resampling.LANCZOS)

    if image.mode == "RGBA":
        output = Path("compressed.png")
        image.save(output, format="PNG", optimize=True)
        if output.stat().st_size <= LIMIT:
            print(f"{output}: {output.stat().st_size} bytes")
        else:
            print("PNG is still too large; convert to JPEG only if transparency is not required.")
    else:
        output = Path("compressed.jpg")
        for quality in range(88, 19, -4):
            image.save(output, format="JPEG", quality=quality, optimize=True, progressive=True)
            size = output.stat().st_size
            if size <= LIMIT:
                print(f"{output}: {size} bytes at quality {quality}")
                break
        else:
            raise RuntimeError("Could not reach the byte limit; reduce dimensions further.")

Install Pillow with python -m pip install pillow. The script uses a 2,000,000-byte limit. If the receiving service defines 2 MB as 2,097,152 bytes, change LIMIT accordingly.

7. PNG or JPEG?

Requirement Start with Reason
Small UI text, terminal output, diagrams PNG Lossless edges stay crisp.
Transparency PNG JPEG has no alpha channel.
Photographic content or gradients JPEG Lossy compression often produces a smaller file.
Strict size limit Resize, then JPEG Lower dimensions usually preserve more readability than extreme quality reduction.
Unknown upload support Check the destination Some forms accept only specific extensions or MIME types.

Inspect small text at 100% zoom after every conversion. JPEG artifacts are most visible around high-contrast letters, thin borders, and repeated patterns.

8. Edge cases and byte-limit details

  • 2 MB can mean two different limits. Decimal 2 MB is 2,000,000 bytes; binary 2 MiB is 2,097,152 bytes. Use the stricter value when the service does not explain its wording.
  • Metadata can add bytes. Exporting a clean copy can remove camera, editing, or color-profile metadata that is not needed for a screenshot.
  • Transparency changes the decision. Flattening a transparent PNG onto white makes JPEG possible, but it permanently removes the transparent background.
  • Long full-page captures are difficult. Crop to the section the reader needs or reduce the width before lowering quality. A very tall image may need both.
  • Text must remain readable. If letters blur, undo the last quality reduction and lower dimensions in a controlled step instead, or keep PNG and crop more.
  • Do not trust the filename. A file named .jpg can still have unexpected encoding details. Inspect the actual format and MIME type before upload.

9. Troubleshooting

Symptom Likely cause Fix
File is still over 2 MB Too many pixels or complex content Crop, then resize proportionally. Convert PNG to JPEG only when transparency is unnecessary.
Text looks fuzzy JPEG quality was reduced too far Raise quality, reduce dimensions less aggressively, or return to PNG.
Transparent areas became black or white JPEG cannot store alpha Keep PNG or deliberately flatten onto a chosen background.
Image is stretched Width and height were changed independently Enable a locked aspect ratio or calculate one dimension from the other.
Upload rejects the file Format, MIME type, or byte limit is unsupported Check the upload rules, export a supported format, and verify bytes after export.
Batch outputs have inconsistent sizes Different source dimensions or encoder settings Use one maximum dimension, one format, and a post-save byte check for every file.

10. Performance, reliability, and cost

  • Fastest manual path: crop and resize in the tool already installed on your computer.
  • Most repeatable path: use a scripted pipeline with fixed dimensions, format, and a byte-size assertion.
  • Best quality under a hard limit: resize before reducing JPEG quality, then compare the result at normal viewing size.
  • Reliable verification: measure the final file after it is written and before it enters an upload or publishing workflow.
  • Cost: built-in tools such as Preview, Paint, and PowerToys avoid adding a separate service for occasional compression. A hosted screenshot API is useful when the screenshot itself must be generated consistently from a URL.

11. Or skip the browser setup

If you first need to create the screenshot from a web page, ScreenshotNeo captures a clean PNG, JPEG, WebP, or PDF with one GET request. Its consent handling accepts cookie banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be turned off. Bot checks, CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and the response identifies the result with X-Page-Verdict and X-Billed headers.

Use the ScreenshotNeo API documentation for the full option set, including full-page captures with lazy images loaded, CSS-selector element captures, device presets, custom viewports, retina scale, custom CSS and JavaScript, waits, blocking rules, headers, cookies, user agents, authorization, geolocation, resizing, caching, signed links, asynchronous jobs, bulk capture, and usage reporting.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

After downloading, apply the crop, resize, format choice, and byte check described above. ScreenshotNeo also provides an MCP server so Claude, Cursor, and other MCP clients can take screenshots, get page information, and capture PDFs. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000. Create a free ScreenshotNeo account.

12. FAQ

What JPEG quality gets a screenshot under 2 MB?

There is no universal percentage. File size depends on pixel dimensions and image content, so export, measure, and adjust. Starting around quality 80–85 is reasonable for experimentation, but verification is required.

Should I reduce resolution or quality first?

Reduce unnecessary pixels first. This usually preserves text better than applying heavy JPEG compression to a very large image.

Can I keep a PNG under 2 MB?

Often, especially after cropping and resizing. If it remains too large, JPEG may help only when you can give up transparency and tolerate lossy edges.

Why is my “2 MB” file rejected?

The service may enforce 2,000,000 bytes rather than 2 MiB, or it may reject your format or MIME type. Check the exact byte count and upload requirements.

What is the safest workflow for important screenshots?

Keep the original, create a separate export, inspect text and transparency at 100%, measure the exported bytes, and retain the settings used so the result can be reproduced.