ScreenshotNeo

BlogHow-to

How to Compress an Open Graph Image Without Losing Preview Quality

Compress an Open Graph image while preserving its intended dimensions and preview quality. Choose a format, compare exports, and validate the published card.

By the ScreenshotNeo team4 October 20267 min read

To compress an Open Graph image without losing preview quality, reduce the encoded file size while keeping the intended pixel dimensions. Export a few candidates, compare them at the size the share card will actually appear, and use the least aggressive compression that meets the destination platform’s requirements. Keep an untouched original and check the preview after publishing.

There is no universal Open Graph quality setting, dimension, or file-size target. The protocol defines image metadata, but the destination platform determines which formats and limits work for its previews. The Open Graph protocol specification documents the metadata fields.

1. Understand what Open Graph requires

The four basic required Open Graph properties are og:title, og:type, og:image, and og:url. The image property points to an image representing the page. You can also provide structured image properties: MIME type, pixel width and height, an HTTPS alternative, and descriptive alt text.

The protocol does not prescribe a universal image dimension, maximum byte size, JPEG quality value, or compression recipe. Treat dimensions and file-size limits published for a social network as that platform’s guidance, not an Open Graph rule.

2. Compress the image step by step

  1. Keep a high-quality master. Preserve the original so you can export again if the result looks soft, blocky, or otherwise damaged.
  2. Keep the intended dimensions. Compression changes how image data is encoded; resizing changes its pixel dimensions. Do not shrink the image just to hit a byte target if that makes it look soft at the card’s display size.
  3. Choose a suitable format. JPEG is a practical starting point for photographs. PNG can suit transparency and sharp-edged, text-heavy graphics, though the resulting file may be larger. WebP supports lossy and lossless compression, transparency, and metadata, but verify that the target platform’s crawler accepts it. RFC 9649 documents WebP.
  4. Make several modest exports. Change the encoder’s quality or compression setting in small steps. There is no quality percentage that works for every image: encoders and image content differ.
  5. Compare at preview size. View candidates side by side at the size people will see in the link card. Check small text, sharp edges, gradients, and fine detail.
  6. Use the least aggressive candidate that meets a real limit. If the destination has a byte limit, re-export and compare until the image fits while remaining clear.
  7. Publish and validate. Use a publicly reachable absolute image URL, accurate metadata, and the destination platform’s preview inspector. Request a fresh scrape if the platform offers one and continues to show an old image.

3. Inspect artifacts and compare candidates

A smaller file is not automatically a better share image. Assess each candidate at the expected card size and compare both visual quality and bytes. Look for:

  • Blur: text, fine lines, or facial features lose definition.
  • Ringing or halos: light or dark outlines appear beside sharp edges.
  • Blockiness: smooth areas or detailed parts break into visible blocks.
  • Banding: a gradual gradient turns into visible steps.
  • Transparency or color changes: the output no longer looks like the source when displayed by the target platform.

Compare candidates on fidelity at preview size, file size, crawler support, edge and transparency handling, and accurate metadata. No single format is guaranteed to produce the smallest or sharpest result for every image.

4. Set accurate image metadata

Point og:image to the final, publicly reachable image. Add the image’s MIME type and actual pixel dimensions when known, and provide descriptive alt text that explains the image’s content rather than using it as a caption. The Open Graph specification describes these structured image properties.

<meta property="og:title" content="Example page title">
<meta property="og:type" content="website">
<meta property="og:url" content="https://example.com/article">
<meta property="og:image" content="https://example.com/images/share-card.jpg">
<meta property="og:image:type" content="image/jpeg">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<meta property="og:image:alt" content="A red bicycle leaning against a brick wall">

Replace the example URL, dimensions, content, and MIME type with values that describe the image you actually publish. Do not leave stale dimensions or type metadata after converting or resizing the image.

5. Treat platform limits as platform-specific

Available secondary guidance gives Facebook-specific figures of 1200 × 630 pixels recommended, 600 × 315 pixels minimum, and an 8 MB maximum. These are claims from og-image.org’s Facebook guide, not requirements in the Open Graph protocol, and are not independently established here from a current Meta primary source.

Wix Help Center guidance says WhatsApp image previews display only when the image is under 300 KB. This is platform-specific secondary guidance, not a universal limit. Check current requirements for the destination and do not apply one platform’s figure to all previews.

6. Validate the live share preview

After publishing, inspect the page with the destination platform’s own debugger or preview tool. Check that it fetches the expected image, displays the current version, and renders the image clearly. The cited guide describes Facebook’s Sharing Debugger and its rescrape control. If the preview still shows an earlier image, request a fresh scrape where supported; cached previews may lag behind a page update.

For a quick visual check, capture the rendered page or share card at the size you need. ScreenshotNeo is a website screenshot API and MCP server from ScreenshotNeo. Its browser capture can help inspect a rendered page, but the destination platform’s own inspector is the relevant check for its cached share preview.

7. Troubleshooting

Symptom Likely cause What to do
The preview is blurry The source was resized too small, or compression softened details. Restore the intended dimensions from the master, export less aggressively, and inspect at card size.
The image looks blocky or has halos Lossy compression is too aggressive for the image’s detail or sharp edges. Increase quality in a small step or try another suitable format, then compare the result visually.
The image is too large for a platform limit The current export exceeds a destination-specific byte limit. Check that platform’s current guidance. Adjust encoding in small steps and compare; do not assume a limit from another platform applies.
The preview shows an old image The platform may be using a cached scrape. Use its debugger or inspector to request a fresh scrape when available, then recheck.
The preview does not show the image The image URL may not be publicly reachable, the metadata may be wrong, or the crawler may not accept the format. Check the absolute URL, image response, MIME type, and dimensions. Try a widely supported format such as JPEG or PNG and inspect again.
Transparency looks different The target viewer may render transparency against a different background, or the export changed the alpha channel. Inspect the output over the backgrounds likely to appear in the share card and use a format and export that preserve the intended appearance.

8. Performance, reliability, and cost

For a single share image, keep the source master and compare a few exports manually; avoid spending time chasing an arbitrary quality number. For many pages, a repeatable export and validation process can reduce rework: preserve dimensions, record output format and bytes, verify metadata, and inspect representative previews after publishing.

Compression reduces transfer size when it reduces encoded bytes, but format support and visual quality still matter. No encoder benchmark or universal savings percentage is established here. Optional categories for larger libraries include image optimization software, online compression services, and image CDNs; evaluate them against your formats, workflow, and platform requirements.

Or skip the browser setup

ScreenshotNeo can return a webpage screenshot with one GET request. See the ScreenshotNeo API documentation for options and setup.

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}`);
  • Cookie banners are accepted and removed before the shot; 60+ known consent platforms, newsletter popups, and chat widgets can be removed, with each step configurable.
  • Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing; response headers identify the page verdict and billing status.
  • An MCP server lets AI agents use take_screenshot, get_page_info, and capture_pdf.
  • 1,000 screenshots a month are free with no card. Paid plans start at $5 for 3,000 screenshots.

Sign up for 1,000 free screenshots a month with no card.

FAQ

Should I resize the image to compress it?

Not by default. Resizing changes pixel dimensions; first try reducing encoded bytes while preserving the intended dimensions, then inspect the result at preview size.

Is WebP always the best choice?

No. WebP supports lossy and lossless compression, but the target crawler must accept it. Verify platform support before publishing.

What quality percentage should I use?

There is no universal value. Export candidates in small steps and choose based on visible quality at the actual preview size and any real platform limit.

Does Open Graph require 1200 × 630 pixels?

No. That figure appears in secondary Facebook-specific guidance; the Open Graph protocol does not set a universal image dimension.