Where the first array corresponds to the x-axis of the image, and the next nested array corresponds to the y-axis of the image
My motivation behind this was to be able to cache bitmaps into Roblox, as a performance optimisation technique (as it means the CPU will not die trying to decode a PNG buffer using MaximumADHDs PNG library). If we can cache large 16k level images (such as the textures I’m using for my game), it means we don’t have to repeatedly request a domain for a PNG buffer, which is great when you are working for mobile!
usage
compile the project
execute the binary and select an image
wait
file will save to a path of your choosing
OR:
navigate to the releases page and download a prebuilt binary
I have used something similar to upload videos into Roblox. Good job on this resource!
However, I ran into problems with optimization and size with the same method you are using, to fix this, I turned the colors to tables with the color value and how many times it has repeated
You can also remove the 1 .0 part of the value and certain spaces. Doing these will improve the size by a lot.
Since I have done videos, I separated them into frames instead of individual pixels.
This is how it looked: (This code has been optimized for Bad Apple, which is black and white, so the color value was only the shade.)
yeah a lot of stuff like decimal precision is just an after-effect of python unfortunately, the tool itself is quick and dirty so i didn’t really see a need to optimise it in this way (it is being used for a hack project right now).
if anyone wants to make quality of life changes or improvements please send a pr to the repository!
that’s a nice technique but i would have to create a lookup module for interpreting this kind of data which i think is out of the scope of the tool itself, definitely something worth looking into though