PNG Encoder Module (Open Source)

I wrote a PNG Encoder that takes RGB(A) values representing an image and returns the binary data that makes up a PNG. This can be used this to upload images online using APIs and http service.

Here is my showcase video:

PNGEncoder.rbxm (18.6 KB)

Before uploading online you will need to convert the binary string returned to base64, but I already provided a function to do that in a example script in the file. The Read Me script provides everything you will need to know on how to use the module. I originally wrote the module in raw Lua and the translated some parts of the code into Luau so it would run in studio. The original code is easier to read since Lua 5.4 has support for native binary operators, but in Luau I had to use the bit32 library and all the function calls are hard to read. Attempting to compress really large images may take long or not be possible because of Roblox’s table limit, but for normal images sizes (up to 1000x1000 or even slightly larger) the module should work fine and fairly quickly. Please credit me or my youtube @AmViv if you plan on using use the module. Heres the raw Lua code for the main PNGEncoder module if anyone’s interested: Raw code

5 Likes

Why is your Roblox Studio UI different than me, and why you have a 4K resolution in your monitor and why is the windows moving so different???

1 Like

It’s the next gen studio UI, you can enable it in the beta features menu.

2 Likes

I’m on Macos, and I have the macbook pro lol

1 Like

YEAHHHHHHHHHHHHHHH I needed this

2 Likes