How to Link to Images Uploaded to GitHub

Introduction

In this tutorial, you'll learn how to link to images uploaded to GitHub.

Steps to Link to Images on GitHub

  1. Upload Your Image: Go to your GitHub repository and upload your image to a directory within the repository. You can do this by dragging and dropping the image into the repository view.
  2. Find the Image URL: Once uploaded, navigate to the image file in the GitHub repository and click on it. Click on the "Download" button or right-click on the image and select "Copy image address" to get the direct URL of the image.
  3. Use the Image URL: To display the image in your markdown or HTML, replace the `blob` in the url to `raw`

if the link was

https://github.com/username/repository/blob/main/image.png

change it to

https://github.com/username/repository/raw/main/image.png

This will redirect you to

https://raw.githubusercontent.com/username/repository/main/image.png

Or you can directly change the link as above

Conclusion

By following these steps, you can easily link to images hosted on GitHub.