Load and save images (JPEG, PNG, BMP, GIF, TGA) in a game or graphics app without external libraries.
Render TrueType fonts as pixels for text display in embedded or game projects.
Decode Ogg Vorbis audio files for sound effects and music in games.
Generate Perlin noise for procedural terrain or texture generation.
stb is a collection of small, self-contained utility libraries for C and C++ programming, each distributed as a single header file. The central idea is that adding a library to a project should be as simple as copying one file, no build system changes, no external dependencies, no linking complications. Each library is either public domain or MIT licensed, meaning you can use it in any project with essentially no legal restrictions. The collection covers 21 libraries spanning graphics, audio, game development, and general utilities. The most widely used are stb_image.h (loading image files in formats like JPEG, PNG, BMP, GIF, and TGA), stb_image_write.h (saving images to disk), stb_image_resize2.h (scaling images up or down with good quality), and stb_truetype.h (parsing TrueType font files and rendering text as pixels). There are also libraries for Ogg Vorbis audio decoding, Perlin noise generation, dynamic arrays and hash tables in C, fast string formatting, voxel rendering, and more. The single-header design works by putting all the code in one .h file. By default including the file only declares the API (the function signatures); you enable the actual implementation by defining a specific macro in exactly one source file before including it. Someone would use stb when writing a C or C++ program that needs image loading, font rendering, or similar functionality without adding a large dependency. It is especially popular in game development, graphics programming, and embedded systems where keeping dependencies minimal is important. The README includes a note that security bugs are discussed publicly and fixes may take time, which is relevant for security-sensitive applications.
Generated 2026-05-18 · Model: sonnet-4-6 · Verify against the repo before relying on details.