whatisgithub

What is gmod-tinysvg?

fruityman577/gmod-tinysvg — explained in plain English

Analysis updated 2026-05-18

15LuaAudience · developerSetup · easy

In one sentence

A pure Lua library for Garry's Mod that parses and renders SVG images as real vector graphics, keeping icons crisp at any size with no dependencies.

Mindmap

mindmap
  root((repo))
    What it does
      Parses SVG in Lua
      Renders true vector icons
    Performance
      Cached per size bucket
      Cheap tint and fade
    Use cases
      Sharp UI icons
      IconSet management
    Coverage
      Paths shapes gradients
      No text or filters

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Draw a game UI icon that stays sharp whether shown at 16 pixels or 2048 pixels.

USE CASE 2

Recolor and fade a white SVG icon without re-rendering it from scratch.

USE CASE 3

Manage a full set of named UI icons with the IconSet helper so they load once and fade in cleanly.

What is it built with?

LuaGarry's Mod

How does it compare?

fruityman577/gmod-tinysvgiogamaster/tuxedo.nvimluismede/netherite.nvim
Stars151515
LanguageLuaLuaLua
Setup difficultyeasymoderateeasy
Complexity1/52/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Drop the single cl_tinysvg.lua file into a Garry's Mod addon, no extra dependencies.

So what is it?

tinysvg is a small library that lets Garry's Mod addons draw SVG images as real vector graphics instead of flat picture files. Normally, showing an icon at different sizes in a game means preparing several versions of the same image at different resolutions, since a regular PNG image gets blurry or blocky when scaled up. SVG images are different: they describe shapes with math instead of pixels, so they can be drawn crisply at any size, from a tiny 16 pixel icon up to a poster sized 2048 pixel version, using the same single file. This project is written entirely in Lua, the scripting language Garry's Mod addons are built in, and ships as one client side file with no outside dependencies. It works anywhere Garry's Mod normally lets you draw things on screen: heads up display overlays, VGUI panel interfaces, and 3D2D world drawing. For performance, tinysvg does not redraw the full vector shape every single frame. Instead, it renders the image once per size it is needed at and reuses that cached result, which keeps the cost low even when an icon is shown often. It also supports recoloring a white icon to any color and fading it in or out without needing to redraw it from scratch, and it comes with an IconSet helper for managing a whole set of named icons that need to load and fade in cleanly. The README lists broad support for common SVG features such as paths, basic shapes, transforms, gradients, and CSS style colors, while a few advanced features like embedded text, images, and filter effects are not supported and get skipped with a warning rather than causing an error. This tool is aimed specifically at people building addons or user interfaces for Garry's Mod who want sharp, resizable icons without maintaining separate image files for every size they need.

Copy-paste prompts

Prompt 1
Show me how to load and draw an SVG icon using tinysvg inside a Garry's Mod HUD Paint hook.
Prompt 2
Explain the difference between doc:Draw and doc:Render in tinysvg and when to use each.
Prompt 3
Walk me through setting up an IconSet for a group of UI icons with tinysvg.

Frequently asked questions

What is gmod-tinysvg?

A pure Lua library for Garry's Mod that parses and renders SVG images as real vector graphics, keeping icons crisp at any size with no dependencies.

What language is gmod-tinysvg written in?

Mainly Lua. The stack also includes Lua, Garry's Mod.

How hard is gmod-tinysvg to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is gmod-tinysvg for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.