Chuantu.de

Image hosting for Markdown and README files

A Markdown file contains text only. Every picture in it is a URL, and whether that picture shows up for your reader depends entirely on where the file sits. This page covers what breaks, the three syntaxes that work, and the sizes that keep a README readable.

Upload an image Resize or compress first

Why local paths break

Writing ![](images/screenshot.png) works until one of three things happens, and all three happen quickly:

Committing the images instead

Putting screenshots in the repo does solve the path problem, and for a handful of documentation images it is the right answer: the picture is versioned together with the text that describes it. The cost is git history. A 400 KB screenshot added once stays in the object database essentially forever, even after you delete the file — ten screenshots a week turns into hundreds of megabytes that every clone has to download. For build logs, walk-throughs and issue attachments, an external host is cheaper.

data: URIs

Base64-inlining an image into the Markdown avoids hosting entirely, but most renderers strip data: URIs for security, and when they do not, a 200 KB PNG becomes roughly 270 KB of unreadable text inside a file people are supposed to review. Not worth it.

Getting a URL that works

  1. Open the upload page and drop the file in. JPG, PNG, GIF, BMP and WebP are accepted; 2 MB per file without an account.
  2. Copy the direct link — it should end in .png, .jpg or .webp, not in a page that surrounds the image.
  3. Paste it into the Markdown. If you want to check it before committing, open the URL in a private browser window: what you see there is what your reader sees.

The three syntaxes

Inline, the one you will use most:

![Screenshot of the settings panel](https://chuantu.de/example-shot.png)

When you need a fixed display width, drop to HTML — Markdown passes raw HTML through, and this is the only way to control size without editing the file itself:

<img src="https://chuantu.de/example-shot.png" alt="Settings panel" width="720">

When the same image appears several times in a long document, define it once at the bottom and reference it by name — renaming one URL then updates every occurrence:

![Architecture diagram][arch]

[arch]: https://chuantu.de/example-arch.png

Posting to a forum instead of a Markdown file? That needs BBCode, which is covered on the forum images page.

Sizes that keep a README readable

Retina screenshots straight out of a laptop are 2 to 3 times wider than they need to be, which is why documentation repos end up with 800 KB PNGs. Practical targets:

ContentWidthFormatTarget size
UI screenshot with text1200–1600 pxPNGunder 300 KB
Photo or product shot1200–1600 pxJPG q80 or WebPunder 200 KB
Diagram or logonatural sizePNG or SVGunder 100 KB

The toolbox handles both steps in the browser: resize to a longest edge of 1600 px, then compress to a target size. If the file must land at a specific weight — some documentation portals enforce one — the 100 KB walk-through covers the settings.

Where these links work

Three things to watch

Frequently asked questions

Does GitHub allow images hosted on an external site in a README?
Yes. GitHub renders external image URLs and proxies them through its own cache, so a direct file URL works in README files, wikis and issue comments.
What is the correct Markdown syntax for an image?
![alt text](https://example.com/image.png). If you need a fixed width, use the HTML form with a width attribute.
Should I commit screenshots to the repository instead?
Yes when the image is part of the documentation and must be versioned with it. No when screenshots are numerous, because binaries stay in git history permanently and slow every clone.
What size should a README screenshot be?
1200–1600 px wide and under roughly 200–300 KB. PNG for screenshots containing text, JPG or WebP for photographs.
Can I use the image URL in a private repository?
The URL is public. Anyone with the link can open the image, so never upload screenshots containing credentials or customer data.

Related