Back
blurry code screenshot fix

Blurry Code Screenshots? Why It Happens & How to Fix It

You spent ten minutes getting the syntax highlighting just right, cropped the window, and hit export. Then you post it, someone opens it on their phone, and the code looks like it went through a fax machine twice.

Or it happens in a meeting room instead of a feed. You’re three slides into a talk, someone in the back asks you to zoom in, and you already are zoomed in. The text is just soft.

Blurry code screenshots feel random, but they almost never are.

A handful of specific, fixable reasons cause this, and they all come down to pixels, compression, or where your image ends up being viewed.

Before the deep dive, here’s what’s usually going on:

  • Your image was captured at a lower pixel density than the screen it’s viewed on. A file made for a standard display looks soft on a Retina or 4K one.
  • You uploaded something small, and it got stretched to fit. Enlarging a raster image always costs sharpness.
  • You exported as JPEG, which distorts hard edges like text and code syntax more than photos.
  • The platform you posted to recompressed your file after you uploaded it. LinkedIn, X, and most CMSs do this automatically.
  • You’re presenting on hardware with far fewer pixels than your laptop, like a conference room projector.
  • Your editor’s font size was too small to survive any of the above, so the damage gets more obvious.

Now let’s look at the actual pixel math behind it.

The Pixel Math Behind Blurry Code Images

The Pixel Math Behind Blurry Code Images

Every screen has two “resolutions” running at once: the number of physical pixels the hardware has, and the number of logical (CSS) pixels your operating system draws content at.

On a standard display, those match 1:1. On a Retina or HiDPI screen, one logical pixel uses multiple physical pixels, which is why text looks crisper on a MacBook or a modern phone than on an older monitor.

MDN’s own documentation on devicePixelRatio puts it plainly: a value of 1 means a classic 96 DPI display, while a value of 2 is expected on HiDPI and Retina screens, and modern phones often go even higher.

If a tool captures your code at a 1x pixel density but the file later gets displayed at a size that assumes 2x or 3x, the result looks noticeably soft, even though nothing about your code or theme changed.

6 Real Causes of Blurry or Pixelated Code Screenshots

6 Real Causes of Blurry or Pixelated Code Screenshots

1. You captured at the wrong pixel density

A basic OS screenshot tool grabs exactly what’s on screen at that moment, at whatever density your display runs at. Move that file to a sharper screen, and it doesn’t have enough pixel data to fill it cleanly.

2. You’re upscaling a small image

If you drop a 600px-wide image into a slide or doc and then resize it to 1200px, you haven’t added detail; you’ve just spread the same pixels over more space. This is the single most common cause of “it looked fine when I made it” syndrome.

3. JPEG is chewing up your text edges

JPEG compression approximates image blocks, which is fine for photos with soft gradients.

Code screenshots are mostly hard edges: sharp letterforms, straight lines, high-contrast syntax colors. That’s exactly what JPEG handles worst, producing fuzzy halos around characters. PNG (or SVG when it’s an option) preserves those edges exactly.

4. The platform recompressed it after upload

Even a perfect export can get mangled after you hit post. LinkedIn, for example, automatically compresses uploaded images, and uploading at the wrong dimensions makes it worse: too small and the platform upscales it for you, too large and its own compression introduces visible artifacts, especially in graphics containing text. Every major platform does some version of this.

5. You’re projecting onto hardware that can’t keep up

Plenty of conference rooms still run projectors at XGA (1024×768) or WXGA (1280×800), resolutions that were standard for office presentations well before your laptop shipped. A crisp 4K export doesn’t help if the projector itself can’t display that many pixels. In that situation, the fix isn’t a higher-res file, it’s bigger text and less content per slide.

6. Your font size and zoom were too small to begin with

If the underlying text was tiny before you exported anything, no amount of resolution will fix that. Small text has less room for anti-aliasing to work, so it degrades first under any compression. This is also where font choice matters: some coding fonts hold up at small sizes far better than others, which is worth a look if you’re regularly exporting for platforms.

How to Fix Blurry Code Screenshots for Good

How to Fix Blurry Code Screenshots for Good

Export at 2x or higher. This is the single biggest lever.

Doubling your export resolution (often called a “retina” or “2x” export) means the file holds enough pixel data to look sharp on both standard and high-density screens, since the extra pixels just get compressed on lower-DPI displays instead of the file running short.

Use PNG over JPEG for anything with text.

PNG is lossless, so your syntax highlighting and character edges come out exactly as designed. Save JPEG for photographs, not code.

Bump your editor’s font size before exporting, especially for presentations**.** If you’re not sure how it’ll read from the back of a room, it probably won’t. This matters more than any export setting once you’re projecting rather than scrolling.

Stop re-exporting an already-compressed image. Screenshotting a screenshot, or re-saving a JPEG as a JPEG, compounds quality loss every time. Always go back to the source.

Use a tool that renders your code, not a photo of your screen.

This is the structural fix. A regular screenshot tool has no idea what’s underneath the pixels; it just grabs what’s visible. A dedicated code-to-image tool builds the image from your actual text and syntax highlighting, so the output resolution isn’t tied to whatever your monitor was doing that day.

Why Screenshot Tools Make This Worse (and What Solves It)

Why Screenshot Tools Make This Worse (and What Solves It)

This is the part most people never think about: a screenshot is a photo of your screen.

A tool like snappify doesn’t take a photo of anything. It renders your code as real, styled text and vector elements on a canvas, the same way a design tool builds a poster, then exports from that canvas at whatever resolution you choose.

Because no screen is being captured, your export’s sharpness isn’t hostage to your display’s pixel density that day.

You can see this concretely in how video exports handle resolution: scale is a setting you pick directly, and a larger scale packs more pixels into the same frame, up to 4x on paid plans.

The same logic applies to why the syntax-highlighted code editor looks identical whether you’re exporting for a phone screen or a 100-inch projector screen: it’s rendering real text, not a captured bitmap.

If you’re generating snaps straight from your IDE, the VS Code and IntelliJ extensions skip the screenshot step entirely, so no capture-and-compress cycle introduces artifacts in the first place.

And if the image is heading somewhere, it can be interactive rather than static, an embedded, accessible snippet sidesteps the whole resolution question, since there’s no raster image to blur or pixelate at all.

That’s also worth doing for a second reason: sharp, well-formatted code screenshots get measurably more engagement than anything that looks thrown together, so the fix here pays off twice.

FAQs:

What resolution should I export a code screenshot at?

There’s no single “correct” number, but exporting at 2x your design size is a safe default for almost anywhere your image ends up, social feeds, blog posts, or presentations. If you know it’s headed to a large projector or a 4K display specifically, go to 3x or 4x if your tool supports it.

Is PNG or JPEG better for code screenshots?

PNG. It’s lossless, so it preserves sharp text edges and syntax highlighting exactly. JPEG’s compression is built for photographs and tends to blur or halo hard edges like letters, which is the worst possible tradeoff for a code image.