This is a little tricky to explain, please change the title if you feel it does not truly describe the problem.
Background: I'm working on a resource loading and saving mechanism for my game engine. I have a class called a data bundle which stores a list of sprite-sheets. Sprite-sheets store the actual pixel data values of a “png” image, its width and height (This cannot be changed as the rendering system requires this data in this format).
The data bundle can write itself to a json file which contains the data from each sprite-sheet in its list. This is all fine but then I figured what if I was able to some how encode? convert? pack? the data values in the pixel array into some data structure such that if it were written to a file, the data points would be less? When I read this file I should be able to convert that data in to the original pixel data.
Is this even possible and how necessary do you think this might be?
If this is not advised please say so but, if this is a possibility please let me know.
Note: I am able to produce a compressed gzip file which I can read and write to, perhaps this is good enough?