PNG, JPEG, and WebP for Images Made of Text
Published
Choose an encoding for a text card from what each format keeps and loses, then compare one real export instead of a generic file-size claim.
Steps
- Fix the pixels first. Choose the preset, template, type size, and wording. Format is the last decision, because it does not repair a cramped layout.
- Export PNG as the reference. Use it to check edges, table rules, and code. Keep this file even if you later upload something else.
- Export a second encoding only for a reason. Try JPEG when a photo dominates and the destination wants a smaller upload. Try WebP when you will put the file on a site that accepts it.
- Compare the actual downloads. Same width, same height, then look at small type and at the byte size in the file manager. Re-check after the platform processes the upload.
Format does not fix the layout
PNG, JPEG, and WebP are three ways to store the same rectangle. They do not change the preset, the template, or the line breaks. If the heading wraps badly, switching format will not unwrap it. Decide the canvas and the words first, using the size guide and a preview at phone width. Then pick an encoding for the file you will actually hand to someone.
The editor writes the preset's width and height at 1× unless you choose 2× or 3× in Export settings. A 1200 × 630 card at 1× is 1200 pixels by 630 pixels in all three formats. 2× and 3× store more pixels for the same layout. If the browser cannot allocate that bitmap, the export stops and tells you to try 1× or a shorter canvas. Type and contrast explains what those pixels become when a feed displays them smaller.
What each encoding is allowed to do
PNG here is lossless. Hard edges — glyph stems, table borders, syntax-color boundaries — stay as the rasterizer drew them. That is why a text card, a command, or a comparison table should start as PNG. You can open the file later and know the softness you see was not introduced by this export. PNG can also store transparency. These templates do not. Every card paints its own solid background, so a PNG from this editor is a colored rectangle, not a sticker. Markdown to PNG is the reference path.
JPEG is lossy and has no alpha channel. The editor calls the encoder at quality 0.95. There is no slider. JPEG is a reasonable bet when the card is mostly a photograph and a compact upload matters more than the last bit of stem sharpness. It is a poor bet for small type, thin rules, and highlighted code, because the artifacts show up as ringing and dirty edges around letters. If you cannot see that on your screen, view the file at the size the feed will use, not zoomed out to a thumbnail. The thumbnail hides the damage and the phone column reveals it. Markdown to JPEG is the same card through that encoder.
WebP from this editor is also lossy. The canvas data URL is requested at quality 0.95, which is not a lossless WebP mode, and the download is cancelled if the browser cannot encode WebP at all. The page tells you to pick PNG or JPEG in that case. Use WebP when you control the page that will serve the file and you know the publishing pipeline will not silently convert it back to something else. It is a weak default for a social upload, because you do not control the recompression and you may not control whether every viewer decodes it the way your browser did. Markdown to WebP walks through that check.
None of this predicts the smaller file. A flat card with long runs of one color and a photo-heavy card compress in opposite directions. "WebP is 30% smaller" is the kind of sentence this page will not make. Measure the pair you are about to upload.
One measured export, not a benchmark
The figures below are a single run of this site's exporter. They describe that run only.
- Canvas: Open Graph preset, 1200 × 630
- Template: Minimal
- Type size: 36, the default
- Padding: 64, the default
- No signature
- Browser encoder: the app's own PNG, JPEG (quality 0.95), and WebP (quality 0.95) paths
The Markdown was:
# Compare three encodings
PNG keeps hard edges. JPEG is lossy. WebP depends on the browser.
- Same canvas
- Same template
- Same font size
| Encoding | Pixels | Bytes |
|---|---|---|
| PNG | 1200 × 630 | 77,434 |
| JPEG, quality 0.95 | 1200 × 630 | 74,523 |
| WebP, quality 0.95 | 1200 × 630 | 38,380 |
On this card the JPEG was only a few kilobytes under the PNG. The WebP file was about half the PNG. That is a description of these three downloads, not a rule. A photograph, a long table, or a dark template can reorder them. The useful part is the method: same pixels, three files, then a look at the letters. For this sample the PNG and the JPEG were hard to tell apart at feed size, which is what you would expect from a flat card with little high-frequency detail, and it is also why a text-heavy card does not automatically justify JPEG.
Read the table as a lab note. If your card adds a screenshot, a long table, or a dark template, export again. The order of the file sizes can change. What should not change is the method: same pixels, three downloads, then a look at the letters.
What happens after you upload
A file on disk and a file in a feed are not the same bytes. Instagram, X, LinkedIn, and Facebook can resize and recompress an upload. Your sharp PNG may be delivered as a smaller, lossier image. That is a reason to keep source type large and contrast obvious, not a reason to skip PNG. You still want a clean master to re-export from when the wording changes. For a site you control, you can serve the PNG or the WebP you exported, and you can keep the other as a fallback if you want one. This app does not generate a picture element for you. It only downloads the file.
Link previews fetch a URL. The bytes at that URL are what the crawler caches, and the cache key is the URL, not the visual. Replacing a JPEG with a PNG at the same address often does nothing until the address changes. That operational detail is in refreshing Open Graph caches.
A practical order
- Export PNG. Check clipping, the last line, and small labels at a narrow width.
- If the destination is a website and WebP is acceptable in that pipeline, export WebP from the same preview and keep the PNG.
- If the card is photo-led and an uploader complains about size, export JPEG from the same preview and inspect the type before you accept the saving.
- If WebP errors, stay on PNG or JPEG. Do not rename a PNG to
.webp. The extension does not change the encoding. - Record the choice next to the Markdown. The next edit should not have to rediscover which file was the one you posted.
Rename the download. The default name is the preset id, plus a page number when the note split. It does not include the format in a way that survives a later "final-final" copy unless you add it. release-note-og.png and release-note-og.jpg can sit beside release-note.md.
Two exports that differ in template or type size are not a format comparison. Change one thing. The template page is where the color decision belongs. This page is only about how those pixels are stored.
Frequently asked questions
- Which format is always smallest?
- None. Flat color, photos, and dense type compress differently. Export the same card twice and compare those files. A single sample is not a rule for the next card.
- Will the social network keep my PNG intact?
- Do not assume that. A site you control can serve the file you uploaded. A feed often recompresses uploads. Judge the posted preview, not only the file on your disk.
- Can I export a transparent PNG from the templates?
- No. The templates paint a solid background. PNG can represent transparency, but these cards do not use that capability.
- Why did WebP export refuse to download?
- The page asks the browser to encode WebP and cancels the download if the canvas cannot. Choose PNG or JPEG in that browser.