Using images in Garry's Mod
How to get a direct image link and use it in addons, HTML panels and materials, for every player on your server.
Why Imgur links stopped working
Since September 2025, Imgur blocks visitors from the UK. Garry's Mod downloads images over each player's own connection, so any addon that points at Imgur shows missing textures or empty panels for UK players. Some other hosts put a bot check in front of their files, which the game can't pass, so those fail the same way.
imgMUTINY links point straight at the file on cdn.mty.gg, with nothing in front of it. They load for everyone, in game and out.
Get a direct link
- Sign in with Steam and upload a PNG, JPG, GIF, WebP or AVIF.
- Copy the link. It looks like
https://cdn.mty.gg/u/7k2m9x4pqa.png. - Paste it wherever the game or addon asks for an image URL.
Addons that take an image URL
Gang logos, keypads, billboards, sprays, loading screens and custom menus usually have a field for an image link. Paste the direct link in. If an addon only accepts certain hosts, ask the server owner to add cdn.mty.gg to its list. MUTINY's addons already allow it.
HTML panels
DHTML and HTML panels load the link like any web page would, and GIFs animate.
local html = vgui.Create("DHTML", parent)
html:SetSize(256, 256)
html:SetHTML([[
<body style="margin:0;background:transparent">
<img src="https://cdn.mty.gg/u/7k2m9x4pqa.png"
style="width:100%;height:100%;object-fit:contain">
</body>]])Materials
To draw an image with surface or render functions, download it once, save it to the data folder and load it as a material. The function below checks the first bytes before saving, so a failed request never gets cached as a broken texture. Materials work with PNG and JPG files.
local function WebMaterial(url, done)
local ext = url:match("%.(%a+)$") or "png"
local path = "imgmutiny/" .. util.CRC(url) .. "." .. ext
if file.Exists(path, "DATA") then
return done(Material("data/" .. path, "smooth mips"))
end
http.Fetch(url, function(body)
local png = body:sub(1, 4) == "\137PNG"
local jpg = body:sub(1, 3) == "\255\216\255"
if not (png or jpg) then return end
file.CreateDir("imgmutiny")
file.Write(path, body)
done(Material("data/" .. path, "smooth mips"))
end)
endThen use it anywhere on the client:
WebMaterial("https://cdn.mty.gg/u/7k2m9x4pqa.png", function(mat)
hook.Add("HUDPaint", "MyImage", function()
surface.SetDrawColor(255, 255, 255)
surface.SetMaterial(mat)
surface.DrawTexturedRect(24, 24, 128, 128)
end)
end)Tips
- Use PNG when you need transparency.
- Materials can't animate. Use an HTML panel for GIFs.
- Keep icons around 256 to 1024 pixels so they download fast for every player.
- If you delete an image, it stops loading everywhere. Keep anything a live server depends on.
Ready? Upload an image, or read the upload guidelines first.