– How is it that the first Mario Bros. game was about 32kb, but a JPEG of the game is over 300kbs in 2023?

532 views

I’ve seen the meme/info-graphic that the original file for Mario Bros. was approx. 32kb, but a picture file would be 10x more.

I’ve googled it and looked, but it seems to have some nebulous answers. Could someone please ELI5?

In: 26

57 Answers

Anonymous 0 Comments

Code is more efficient than pictures.

To make a sprite dance around a screen, you have to have the sprite, which in the case of Mario Bros is only a few pixels (Mario was literally 12×16 pixels, 142 coloured pixels in total) and a two 8 (or maybe even only 7) bit numbers for coordinates to say where on the screen ot is. If that sprite is only made out of like 16 possible colours, that’s 4 bits per pixel to describe it. Some pixels won’t even have colours, so they don’t need to have anything. So that’s 590 bits to put Mario on a black background (I don’t know if that’s the actual number, but it’s just to compare with the following).

An image has to save ALL of the pixels from the whole image. So if you have a 256×244 image (the game’s resolution), even at the same 16 colours (4 bits per pixel) that’s already 31kb (without compression or anything, of course).

Add some really clever coding tricks, and you have a really small game size.

For comparison, in 2004 .kkrieger won a small size game file competition. It’s an FPS with graphics comparable to the best of its time. It was 96kb. Just three times that of Mario Bros. All because it had no actual art assets, everything was code (some very clever procedural generation stuff).

You are viewing 1 out of 57 answers, click here to view all answers.