8 pixels, assuming RGB24 makes 3 bytes per pixel, which makes the entire “green byte” take up 24 bytes in colors alone, if we also put in 8-bit unsigned integers for each pixel denoting x and y position of the pixel on screen, we get 2 extra bytes per pixel, which makes 5 bytes per pixel, or 40 bytes total. Multiply that by 2 (2 frames in the animation) and we get whopping 80 bytes, definitely WAY more than a single “green byte”.
Even if we store the color as a single byte (3/3/2), we still get 8 bytes for colors per frame and 2 extra bytes for positions, which would make the animation take up 48 bytes.
We could also cheat and store position as one byte as well (4 bits for X, 4 bits for Y), it still would make it take up 32 bytes for 2 frames.
If we use offsets and repeating patterns, we could theoretically bring the size of 2 frames down to 6 bytes, but it won’t go below that.
I understand this.
Wow!
My body was not ready for this
geekpostingEven if we store the color as a single byte (3/3/2), we still get 8 bytes for colors per frame and 2 extra bytes for positions, which would make the animation take up 48 bytes.
We could also cheat and store position as one byte as well (4 bits for X, 4 bits for Y), it still would make it take up 32 bytes for 2 frames.
If we use offsets and repeating patterns, we could theoretically bring the size of 2 frames down to 6 bytes, but it won’t go below that.
Edited