literallywize/pnguin
A relatively fast, pure Luau PNG library
A relatively fast, pure Luau PNG library
Lightweight, performant, and memory-efficient Luau implementation of the PNG image format! ![]()
What this library does:
🟢 Extracting all critical PNG chunks: IHDR, PLTE and IDAT
🟢 Decoding RGBA pixel data from PNGs of any bit depth and color type
🟢 Decoding simple transparency via the tRNS chunk
🟢 Modest error checking for invalid or corrupt PNG data
What this library does...n't:
🔴 Encoding PNG data (planned)
🔴 Parsing chunks besides the ones listed above (planned)
🔴 Decoding interlaced PNGs (planned)
🔴 Decoding PNGs larger than ~1GB, this is due to Luau buffer limitations
Installation
Using Roblox
.rbxm binaries can be downloaded and imported directly from the Releases page.
Using pesde
PNGuin is available as a pesde package, and can be installed using the following commands:
pesde add literallywize/pnguin
pesde install
Usage Example:
local PNGuin = require(path.to.PNGuin)
local png -- Your PNG binary data
local pngInfo = PNGuin.Extract(png)
local pixelData, elapsed = pngInfo:DecodeRGBA()