finds.dev← search

// the find

nothings/stb

★ 34,305 · C · NOASSERTION · updated Apr 2026

stb single-file public domain libraries for C/C++

A collection of 21 single-file C/C++ libraries covering image loading/writing/resizing, font rasterization, audio decoding, and various game-dev utilities. The entire premise is drop-in portability: copy one .h file into your project and you're done. Primarily aimed at game developers and anyone writing C who wants basic media handling without a dependency manager.

stb_image.h handles JPG, PNG, TGA, BMP, PSD, GIF, HDR in ~8000 lines of C with no dependencies — that breadth in a single file is genuinely hard to match. stb_truetype.h gives you font rasterization, SDF generation, and glyph packing without freetype, which is a meaningful reduction in build complexity for small tools. stb_ds.h brings typesafe dynamic arrays and hash maps to C via macros — the design is clever enough that it compiles cleanly in C++ too. Public domain (with MIT fallback) means zero legal friction: no attribution required, no license compatibility headaches, no lawyer conversations.

The project's own README warns that security-relevant bugs are discussed publicly and may take significant time to fix — stb_image in particular has had a long history of CVEs from malformed image inputs, which matters if you're processing untrusted files. SIMD support in stb_image is a dead end on GCC: you get SSE2 only if you compile with -msse2 globally, otherwise you get scalar, and the maintainer has given up on runtime detection. The author still targets MSVC 6 (1998) as their IDE, which explains why stb skips C99 features like stdint.h and mid-block declarations — this is a real constraint, not just a quirk. stb_voxel_render.h is sitting at 0.89 after years and stb_tilemap_editor.h at 0.42, suggesting that the less-used libraries are effectively in maintenance limbo.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →