Generate charts or data visualizations as image files from a Go program
Create automated thumbnails or banners without any graphics software
Build illustrations or diagrams in code and export them as PNGs
Produce animated or batch-generated graphics using loops and transformations
| fogleman/gg | terraform-docs/terraform-docs | consensys/quorum | |
|---|---|---|---|
| Stars | 4,772 | 4,772 | 4,771 |
| Language | Go | Go | Go |
| Setup difficulty | easy | easy | moderate |
| Complexity | 2/5 | 2/5 | 4/5 |
| Audience | developer | ops devops | pm founder |
Figures from each repo's GitHub metadata at analysis time.
Pure Go, no external graphics dependencies. Install with go get github.com/fogleman/gg and import in your file. Font loading requires a local font file path.
gg is a Go library for drawing 2D graphics and saving the results as image files. It is written entirely in Go, with no external graphics dependencies, and provides a straightforward API for drawing shapes, text, and images onto a canvas. You create a drawing context by specifying a width and height in pixels. From there you can draw circles, rectangles, lines, arcs, ellipses, and polygons using simple function calls. Colors are set with RGB or hex values. Text can be drawn at any position with optional anchoring and word wrapping. You can load custom fonts by specifying a path to a font file. The library also supports more advanced features. You can apply gradients: linear, radial, and conic. Transformations let you translate, scale, rotate, and shear the canvas, and each of these can be applied around an arbitrary point rather than just the origin. Clipping regions let you restrict drawing operations to a defined area. The Push and Pop functions save and restore the drawing state, making it easy to apply temporary transformations without affecting the rest of the image. When you are done drawing, you save the result as a PNG file with a single function call. The library is useful for generating images programmatically, such as creating charts, illustrations, visualizations, or automated thumbnails. The README includes short code examples that show how to draw a filled circle and how to draw overlapping ellipses using a rotation loop. A set of additional example programs is included in the repository for reference.
gg is a Go library for drawing 2D graphics and saving them as PNG files. No external dependencies needed, just write Go code to draw shapes, text, gradients, and images onto a canvas, then save the result.
Mainly Go. The stack also includes Go.
MIT license, free to use in personal and commercial projects, no restrictions.
Setup difficulty is rated easy, with roughly 5min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.