Lua-GD is a set of Lua bindings to the Thomas Boutell's gd library that allows your code to quickly draw complete images with lines, polygons, arcs, text, multiple colors, cut and paste from other images, flood fills, read in or write out images in the PNG, JPEG or GIF format. It is not a kitchen-sink graphics package, but it does include most frequently requested features, including both truecolor and palette images, resampling (smooth resizing of truecolor images) and so forth. It is particularly useful in Web applications.

Lua-GD is a programming library, not a paint program. If you are looking for that or are not familiar to the Lua Programming Language, you are in the wrong place.

The Lua-GD API is not identical to the gd C API: it was changed in a way that make it more familiar to Lua users and use the extra power provided by Lua, at cost of some learning for those that already use gd. Documentation on API are available on the download package and as an online manual.


A note on version numbers: Lua-GD version numbers are in the format "X.Y.ZrW", where X.Y.Z indicates the gd version and W the binding version. So, the 2.0.33r1 version is the first binding version for gd 2.0.33 and 2.0.33r2 has some improvements, bug fixes, etc. but uses the same gd version.

Licensing information

Lua-GD is copyrighted free software, distributed under the MIT license (the same used by Lua 5.1) and it can be used at no cost for both academic and commercial purpouses. You need also to agree with to the gd license. If you use this package in a product, an acknowledgment in the product documentation would be greatly appreciated (but it is not required).

Important: Lua-GD 2.0.33r1 and older releases were distributed under the GNU Library/Lesser Public License 2.1 (LGPL). This license doesn't apply to 2.0.33r2 and newer versions.


The most recent stable packages are available in the Lua-GD releases page in GitHub and in the mirror on Sourceforge. There are also some pre-compiled binary packages available for Linux and some other Unix systems.

The latest, unstable, code is always available in the master branch of the Git repository (also available as a ZIP download). Please note that code from this branch is still under active development.


Lua-GD is developed in GitHub. Bug reports, patches, pull requests, ports to other systems, etc. are welcome.


Alexandre Erwin Ittner
E-mail: (e-mail obfuscated to avoid spam-bots. Please replace the "#" with an "@")
PGP Key:
0x0041A1FB (key fingerprint: 9B49 FCE2 E6B9 D1AD 6101 29AD 4F6D F114 0041 A1FB)