Need help squeezing a player canvas data into as much little space as possible!

Hey there,

I’m in a bit of a pickle with a Roblox project I’m working on, and I could really use your brainpower. Here’s the deal: I’m trying to save player-painted masterpieces, but Roblox is throwing a fit with its 4MB limit per entry.

I tried saving each pixel’s X and Y on individual, but that seems to take much more space than I thought, considering that Roblox saves data as characters (byte) instead of bit, and so I thought maybe I could make a detection system where it detects IF any of the surrounding pixels around a singular pixel, IS of the same properties (Color, Opacity . . . etc.) and add a data holder signifying the direction of the surrounding pixel and the number of it; but that one seems to be a hell lot of work and I don’t have the capacity in my mind to rethink all my life choices, anyways, after that I tried compiling all the Pixel’s coordinates using the old base64 trick, but that only seems to cover up 35% free space overall, and it only works for large file data’s such as 10,000 bytes and stuff, u know . Leaving me with no dice howsoever. So, I’m on the hunt for a fresh approach.

I also know that there could be a use of more than just one datastore but I don’t really think if that’s really applicable or not, I would love if u answer this question too!

Got any wild ideas or sneaky hacks up your sleeve to help me squeeze the players data so it allows more than 10 pictures for a 4MB box? I’m all ears!

Thanks a bunch!!

If you’re using EditableImages, here’s a really solid resource you can use: QOI: The Fast and Lossless Image De-/Compressor, ported to Luau

3 Likes

Whatever approach you’re using for images, as already suggested I think your best bet is to write an implementation for an image compression and decompression algorithm. You could probably modify the code for the QOI implementation to suit your needs.

2 Likes

Wow, never heard of such thing, I will try implementing it right away, but may i ask few questions, the documentation said this is a beta feature and cannot be used by published games, is that true for the moment or has anything changed by now?

Unfortunately, it is still true for the moment. The feature, as far as I know, was said to be released around 2025. Also, thank you @Katrist for recommending my resource! Really means a lot to me :slightly_smiling_face:

2 Likes