Pick a WebP canvas for a place you control
WebP can be a good delivery format when Markdown images will live in a website or documentation library. The authoring file stays editable as text, and the image is a small asset that serves a specific visual purpose. Start by separating the exported pixel dimensions from the display width in your page. A larger source gives the browser room on a high-density screen, but more pixels also affect download bytes. Decide where the asset will display before you optimize the file.
| Placement | Editor canvas | Check before replacing the original |
|---|---|---|
| Horizontal docs illustration | 1200 × 630 wide | Check the exported size and image readability in the article column |
| Compact feature card | 1080 × 1080 square | Inspect the rendered size in the grid, including its mobile column |
| Tall visual checklist | 1080 × 1350 portrait | Ensure the text remains readable on a narrow screen |
| Social website preview | 1200 × 630 OG | Validate the format with the destination's crawler and inspect the shared URL |
The editor can produce a particular canvas, while your page layout controls how it is displayed. Keep key content inside the card padding. A safe margin for a normal article graphic depends on the container and any CSS crop, such as object-fit: cover. A feed or link crawler can apply its own presentation. For a site you control, choose responsive styling that preserves the original aspect ratio if the whole card is meant to remain legible. Avoid putting essential instructions in the last line of an image that will be placed in an arbitrary aspect-ratio box.
Export and verify a WebP in four checks
- Prepare the Markdown as a portable source. Give the card a heading that also makes sense in surrounding prose. Use a single table or short block rather than a copy of an entire article. Save that text next to the documentation if you plan to revise the illustration later.
- Select a canvas and open the smallest viewer. Pick the same preset that the final layout can display without cropping. If you are testing several encodings, keep the template, size, font, and padding unchanged across exports. Review the text at a narrow viewport in the final page to catch bad line wrapping and text too small to be useful.
- Export WebP and take a PNG control. Pick WebP in the export selector, download, then produce a PNG of the same design. Compare both size and legibility. On a site with many cards, also try a photo-heavy example and a text-heavy example. The gain from one composition may not generalize across the library.
- Verify the served asset after upload. Open the uploaded URL directly and check that the server or CMS delivers a usable image with the expected content type. Add descriptive alt text or an adjacent text version, and give the image dimensions so the layout can reserve space. If a publishing surface does not accept WebP, retain a PNG or JPG for that surface.
Three reproducible comparisons
- Tutorial hero card. Adapt Blog summary to a tutorial where the article column is narrower than the source image. Export wide WebP and PNG. Compare both files at the actual column width and on a phone. Decide whether any difference in headline edges matters after the page scales the image.
- Documentation snippet. Load Code snippet and choose a short snippet with quotes and indentation. Check both the dark background and the smallest punctuation. Use the Markdown or a separately copyable code block below the image. The card can show the result at a glance while the article provides the command itself.
- Asset library comparison. Start from Tutorial checklist and create two different cards using the same template, one with a short checklist and one with a larger table. Compare their PNG and WebP sizes independently. Track the byte sizes after uploading, because a CMS pipeline can optimize or convert assets between your local export and the actual published URL.
When the website benefits from WebP
Choose WebP for a site where you control asset upload, serving, and fallback. It is an especially useful comparison for landing pages and documentation with several illustrations, where a size difference repeats across the page. Start with the largest or most frequently viewed images. Check the delivered resources rather than only the local download folder. A large savings on an asset that never appears near the initial view may matter less than a small improvement to the first image people see.
Use PNG when small type, table rules, or colorful syntax should remain as close as possible to the rendered canvas. Use JPG if a receiving workflow explicitly expects a JPEG file. Social image upload support and link-preview crawler support can differ from browser support, so inspect each publishing path. It can be sensible to keep a WebP serving copy for a website and a PNG for its social link preview. Saving the Markdown alongside both versions gives you one editable source even when the delivery formats differ. Avoid converting a visually degraded JPEG into WebP in the hope that it will restore lost detail. Re-render the source and compare the new exports.
Troubleshoot encoding, transparency, and serving
Some canvas implementations return a PNG if the requested encoder is unavailable. Opening the downloaded file in the same browser can hide that difference because the browser can decode both formats. If an image processor rejects a WebP file, check its actual encoding with a file inspection utility or use a browser with WebP canvas encoding support and export again. A file extension and an HTTP header are useful checks, but the bytes determine which decoder can open the asset.
WebP as a format supports transparency, while the editor templates paint their own backgrounds. Check the rendered corners against different backgrounds if alpha is essential. For a downloadable illustration embedded on a responsive site, add a visible caption or describe the output in the surrounding article. If the image shows text that is central to the task, keep a real text copy in the page so users can search and copy it.
For troubleshooting a cache problem, publish the new asset at a distinct filename and point the page to that URL. Open it in a fresh session to confirm that the upload changed. When a CMS rewrites the URL, inspect the final network response and the dimensions the browser actually received. This makes it possible to tell browser fallback, server conversion, and stale images apart.
Frequently asked questions
- Does choosing WebP make the image lossless?
- The tool requests WebP from the browser at a fixed quality setting. Use PNG if you need a lossless export of the rendered pixels.
- Is WebP guaranteed to be smaller?
- No fixed ratio applies. Export the same card in both formats, compare the sizes, and check that the smaller image keeps the details you need.
- Can I use my WebP export as og:image?
- Support depends on the destination. Host it at an accessible URL and test the actual shared page with the relevant preview inspector. Keep a PNG or JPG fallback for cases where WebP fails.
- Why does an uploader reject a .webp file that opens locally?
- Check the encoded file type as well as the extension and upload requirements. Some browsers can fall back to PNG when a requested canvas encoder is unavailable.
- Does the preview resize the downloaded file?
- The editor display can scale to fit the window, while the export uses the selected preset's full dimensions.
- Can I get a transparent WebP with a colored editor template?
- The template colors are rendered into the output. Use an editor or pipeline with explicit transparency if you need a clear background.