Have two images with the same dimensions.
I want to create a file that contains information on what pixels are different between the two images. The file should also tell me the value of the new pixel (integer).
An example of such file is
230,8528
291,920
550,1500
Which tells me that the pixel at index 230 changed to 8528. The one at 291 is now value 920. And the pixel at 550 has value 1500.
I already have the means to get all such data (the indexes where they change and their new integer values). My problem is the storage of such info, which needs to be as small as possible and of course easy to iterate when my program needs to read this data back.
What I got currently is the following file format:
[pixel color], [index], [index], [index], ...
[pixel color], [index], ...
[pixel color], [index], [index], ...
Basically, each line represents a pixel color that has changed, and then separated by commas are the indexes of the pixels that will change to such color.
Is there a more suitable/efficient file structure to achieve this kind of data storage?