Generate pixel-art images and learn about binary file formats and run length encoding (RLE) compression. Uses the minimum possible number of bits per pixel based on usage of colours from the fixed colour palette below (ie a black/white image uses a 1-bit index, while using all 16 colours requires a 4-bit index). The RLE run-length is dynamically selected to maximise compression of your image.
Non-compressed data size: bits ( bytes) based on a -bit colour index.
Compressed data size: bits ( bytes). Uses dynamic run-length RLE with a -bit colour index followed by a -bit run length. First 8-bit byte is for meta data (version; palette index bits; run length bits)
URL-safe Base64 encoded version of the compressed binary data.
As well as the pixel data, the file would need to store data for things such as: image width and height; colour values at each index; bits per run; file signature header. This data is placed at the beginning of the file.