Run it
Copy the script and paste it into your executor.
sub, format, split, , = .sub, .format, .split, , .spawn
PNG = {}
PNG.__index = PNG
chunks = {};
modules = {};
(folder)
r = {}
( .. folder)
_, file , ( .. folder)
ChunkName = ((file, )[], , #(file, )[] - )
r[ChunkName] = ((file))()
r;
_, item , :():(({
Url = .. folder,
Method = ,
Headers = {
Accept =
}
}).Body).payload.tree.items
Content = :((, folder, item.name))
( .. folder .. .. item.name, Content)
r[(item.name, , #item.name - )] = (Content)()
r
n, v , ()
chunks[n] = v
n, v , ()
modules[n] = v
Deflate = modules.Deflate
Unfilter = modules.Unfilter
BinaryReader = modules.BinaryReader
(colorType)
colorType == colorType ==
colorType ==
colorType ==
colorType ==
(value, min, max)
num = (value)
num = .(num + )
.(num, min, max)
(file, x, y)
width = file.Width
height = file.Height
x = (x, , width)
y = (y, , height)
bitmap = file.Bitmap
bpp = file.BytesPerPixel
i0 = ((x - ) * bpp) +
i1 = i0 + bpp
bitmap[y], i0, i1
PNG:(x, y)
row, i0, i1 = (self, x, y)
colorType = self.ColorType
color, alpha
colorType ==
gray = (row, i0, i1)
color = .(, , gray)
alpha =
colorType ==
r, g, b = (row, i0, i1)
color = .(r, g, b)
alpha =
colorType ==
palette = self.Palette
alphaData = self.AlphaData
index = (row, i0, i1)
index = index +
palette
color = palette[index]
alphaData
alpha = alphaData[index]
colorType ==
gray, a = (row, i0, i1)
color = .(, , gray)
alpha = a
colorType ==
r, g, b, a = (row, i0, i1)
color = .(r, g, b, a)
alpha = a
color
color = .()
alpha
alpha =
color, alpha
PNG.(buffer)
reader = BinaryReader.(buffer)
file =
{
Chunks = {};
Metadata = {};
Reading = ;
ZlibStream = ;
}
header = reader:()
header ~=
(, )
file.Reading
length = reader:()
chunkType = reader:()
data, crc
length >
data = reader:(length)
crc = reader:()
chunk =
{
Length = length;
Type = chunkType;
Data = data;
CRC = crc;
}
handler = chunks[chunkType]
handler
(file, chunk)
.(file.Chunks, chunk)
success, response = ( ()
result = {}
index =
Deflate:
{
Input = BinaryReader.(file.ZlibStream);
Output = (byte)
index = index +
result[index] = .(byte)
}
.(result)
)
success
( .. (response), )
width = file.Width
height = file.Height
bitDepth = file.BitDepth
colorType = file.ColorType
buffer = BinaryReader.(response)
file.ZlibStream =
bitmap = {}
file.Bitmap = bitmap
channels = (colorType)
file.NumChannels = channels
bpp = .(, channels * (bitDepth / ))
file.BytesPerPixel = bpp
row = , height
filterType = buffer:()
scanline = buffer:(width * bpp, )
bitmap[row] = {}
filterType ==
Unfilter:(scanline, bitmap, bpp, row)
filterType ==
Unfilter:(scanline, bitmap, bpp, row)
filterType ==
Unfilter:(scanline, bitmap, bpp, row)
filterType ==
Unfilter:(scanline, bitmap, bpp, row)
filterType ==
Unfilter:(scanline, bitmap, bpp, row)
(file, PNG)
PNGLoads code from the internet. It downloads more code when it runs (loadstring + HttpGet), which can change after it was posted. From: github.com, raw.githubusercontent.com.
Decode & Encode PNG files in pure luau, Original script at https://github.com/MaximumADHD/Roblox-PNG-Library I only modified it to work for exploits, as the original used functions such as require(script.modules), etc.. Use this by doing loadstring(game:HttpGet("rawscript"))().new(raw_png_data)