Using GitHub to Host Images
Sat, 14 Jan 2023 14:57 UTC by garethbrown
For simple image hosting scenarios, you can host images directly out of a public GitHub respository by following these steps:
Browse to image on github.com, e.g.
Here you will see the GitHub page providing access to view / download the file. But we want the raw file, without GitHub page content wrapping it.
A 'Raw' button doesn't exist for image files, but you can add
?raw=true to end of URL.
Hit enter. You will be redirected to a URL as below.
Here is the image as found at the above URL:
Note: The redirect adds the
raw sub domain part, changes domain to
githubusercontent.com and removes the
blob portion of the path.
Test the link in an unauthenticated browser, and then use as required.