Image not showing up in README.md on GitHub

ImageUrlGithub

Image Problem Overview


I am trying to add an image to the README.md in my repository using markdown below:

![ScreenShot](https://github.com/i-saumitra/Voice-controlled-MP3-Player/blob/master/screenshot.jpg)

But the image is not showing when I visit my repository. Instead the link to the image is showing up. Clicking the link will open the image in new window.

I have also tried using relative path:

![ScreenShot](screenshot.jpg)

But this is giving page not found error.

What is the correct markdown to display image in README.md

Both README.md and image file are in same path/directory.

What is the correct way to display an image in github README.md?

Complete content of README.md file is as below:

Voice-controlled-MP3-Player
===========================

A MP3 player which accept voice command like PLAY, PAUSE, FORWARD, etc. Using C# and Microsoft Speech API.

![ScreenShot](https://github.com/i-saumitra/Voice-controlled-MP3-Player/blob/master/screenshot.jpg)

Image Solutions


Solution 1 - Image

Updated content

Since January, 30th 2013, GitHub now supports relative links in markup documents.

This means that your code ![ScreenShot](screenshot.jpg) would now work flawlessly.

As pointed by @Brad, this may also ease a scenario where the images are different in two branches, but bear the same. In that case, switching from one branch to another, would dynamically switch the image in the rendered view, thus without requiring any change to the Readme content.

You have to use the raw url format. In your case that would be https://raw.githubusercontent.com/i-saumitra/Voice-controlled-MP3-Player/master/screenshot.jpg

This means that the correct markdown would be the following

![ScreenShot](https://raw.githubusercontent.com/i-saumitra/Voice-controlled-MP3-Player/master/screenshot.jpg)

Using this in a .mdfile on github will display the following picture ;-)

ScreenShot

Update following your comment

>where is this officialy documented that we have to use raw...i couldn't find it anywhere

This URL format is an undocumented feature of the GitHub site. This means that it could change later. If that ever happens, in order to "rediscover" the new format, click the Raw button when displaying a image. This will "open" the image in your browser. Copy the URL and Voilà!

raw

Note: Although the repository is no longer on hosted on GitHub, I've updated the urls to reflect the new GitHub policy regarding user content

Solution 2 - Image

You really should use relative urls. That way they'll work better for private repos as well.

![ScreenShot](/screenshots/latest.png)

supposing your repo has latest.png inside the screenshots folder.

~B

Solution 3 - Image

For relative URL's to work with images, wrap it inside the paragraph tag.

I was facing the problem, especially when working with the single image.

Example:

<p>
	<img src="relativePath/file.png" width="220" height="240" />
</p>

Solution 4 - Image

An extension to previous answers...

The image would not show for me when the line:

![ScreenShot](/image.png)

Was directly below a <h2></h2> line and I needed to add an empty line between them.

Hopefully this saves someone some time!

Solution 5 - Image

Thought I would update this for 2019 as I had trouble figuring this out for myself. I uploaded my images to a repo on GitHub, and then used the raw url of the image to import it into my markdown file. To get the raw url, click on the specific image link in GitHub so you are on the page for that specific image. To the top right of the photo, there are two buttons, "Download" and "History". If you click "Download", it takes you to that raw url with the picture taking up the full screen. Copy that url, and then paste it like this in your markdown file:

![image description or alt text](https://raw.githubusercontent.com/i-saumitra/Voice-controlled-MP3-Player/master/screenshot.jpg)

The button used to say "Raw" not "Download" so I hope this helps people find it.

Solution 6 - Image

This may not be relevant to previous answers. I have the same question as the OP - I was directed here and it didnt help me. I hope I can help add light to this question however - as it covers the possibilities of why images does not render in README.md file.

The issue I encountered is that the file name README.md file is written as readME

Not only its missing .md its also written differently.

Apparently, we should not rename the README.md file. It has to be the original name of that file in order to render the images or gifs you want to upload on github README.md page. Hope this helps someone, in rare of occasions, just like I did.

Solution 7 - Image

Check the file extensions because .png is not the same as .PNG.

Also use / instead of \ while specifying the file path.

Solution 8 - Image

Side note, when using reStructuredText use:

.. image:: /screenshots/latest.png?raw=true

Solution 9 - Image

I've tested with "Copy path" and in some locations this was working and in others it didn't.

enter image description here

In the cases it didn't, I copied the permalink and used it instead.

Solution 10 - Image

It doesn;t work when there are any html tags just above the line where image is being imported. You can try removing the html code or add some blank lines for the image to show on Readme.

Solution 11 - Image

I had to add a <br> to return a line in order for the image to show on mine. This discovery was inspired by the comment in this thread to leave a blank line after a

tag.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionAnonGeekView Question on Stackoverflow
Solution 1 - ImagenulltokenView Answer on Stackoverflow
Solution 2 - Imagebosky101View Answer on Stackoverflow
Solution 3 - ImageRakesh YembaramView Answer on Stackoverflow
Solution 4 - ImageJosh MittonView Answer on Stackoverflow
Solution 5 - ImageAmandaView Answer on Stackoverflow
Solution 6 - ImageGelView Answer on Stackoverflow
Solution 7 - ImagePragato BhattacharjeeView Answer on Stackoverflow
Solution 8 - ImagebrianrayView Answer on Stackoverflow
Solution 9 - ImageTiago Martins PeresView Answer on Stackoverflow
Solution 10 - ImageHardik KambojView Answer on Stackoverflow
Solution 11 - ImageMDShieldsView Answer on Stackoverflow