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  works until one of three things happens, and all three happen quickly:
- The reader is not you. On GitHub, in a wiki, in an issue tracker or in a chat preview, there is no
images/folder next to the text you pasted. You get an empty frame with the alt text. - The file moves. Rename a folder, split a chapter into its own directory, and every relative path below it is wrong. Markdown has no linker to fix them for you.
- You are reading it somewhere else. Paste the same note into a blog, a ticket or an email and the local path means nothing outside your machine.
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
- Open the upload page and drop the file in. JPG, PNG, GIF, BMP and WebP are accepted; 2 MB per file without an account.
- Copy the direct link — it should end in
.png,.jpgor.webp, not in a page that surrounds the image. - 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:

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:
| Content | Width | Format | Target size |
|---|---|---|---|
| UI screenshot with text | 1200–1600 px | PNG | under 300 KB |
| Photo or product shot | 1200–1600 px | JPG q80 or WebP | under 200 KB |
| Diagram or logo | natural size | PNG or SVG | under 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
- GitHub, GitLab, Gitea: README, wikis and issue comments render external image URLs. GitHub fetches them through its own image cache, so a hotlink-friendly host is all you need.
- Static site generators: Hugo, Jekyll, Astro and Docusaurus all accept an absolute URL in front matter (
image: https://…) or straight in the body. - Editors: Obsidian, Typora and most Markdown previews render remote images once you are online.
- Stack Exchange and Q&A sites: they require HTTPS image URLs, which is what you get here.
- Issue trackers and chat: Jira, Linear, Slack and Discord unfurl a direct image link automatically.
Three things to watch
- The URL is public. There is no authentication on the file itself, so a README in a private repository still exposes its images to anyone who has the link. Blur account names, tokens and email addresses before uploading — the toolbox has a local blur and a mosaic brush for exactly that.
- Strip EXIF before publishing photos. Camera model, capture time and GPS coordinates travel inside the file. One pass through the toolbox removes them.
- Keep the original. Hosting is a convenience copy, not a backup. If an image matters to the project, keep the source file next to the text that uses it.
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?
. If you need a fixed width, use the HTML form with awidthattribute.- 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.