Prediction-Encoded Pixels - a tiny yet powerful single-header pixel art compression method that focuses on size
Prediction-Encoded Pixels - a tiny yet powerful single-header pixel art compression method that focuses on size
This format is specifically designed to be for low-color pixel art ( "PNG max" is the maximum compression via pngslim, and is a lot slower (10s of seconds) than the usual "PNG fast" that comes from exporting via Aseprite/magick/etc.
112x96 : 4 colors (channel_bits:4)
| Format | Size (bytes) | Compression Ratio | Speed |
|---|---|---|---|
| PEP | 539 | 0.098x | Fast |
| JPEG XL | 652 | 0.119x | Fast |
| WebP | 874 | 0.159x | Slow |
| PNG (max) | 906 | 0.165x | Very Slow |
| GIF | 1,047 | 0.191x | Faster |
| PNG (fast) | 1,081 | 0.197x | Faster |
| QOI | 2,425 | 0.441x | Very Fast |
| BMP | 5,494 | 1.00x | Very Fast |
192x144 : 2 colors (channel_bits:1)
| Format | Size (bytes) | Compression Ratio | Speed |
|---|---|---|---|
| PEP | 796 | 0.222x | Fast |
| JPEG XL | 913 | 0.255x | Fast |
| WebP | 1,252 | 0.349x | Slow |
| PNG (max) | 1,256 | 0.350x | Very Slow |
| PNG (fast) | 1,835 | 0.512x | Faster |
| GIF | 1,919 | 0.535x | Faster |
| BMP | 3,586 | 1.00x | Very Fast |
| QOI | 6,669 | 1.860x | Very Fast |
640x200 : 251 colors
| Format | Size (bytes) | Compression Ratio | Speed |
|---|---|---|---|
| PEP | 70,829 | 0.549x | Fast |
| WebP | 71,722 | 0.556x | Slow |
| PNG (max) | 81,038 | 0.628x | Very Slow |
| JPEG XL | 81,276 | 0.630x | Fast |
| PNG (fast) | 85,375 | 0.661x | Faster |
| GIF | 96,997 | 0.751x | Faster |
| BMP | 129,078 | 1.00x | Very Fast |
| QOI | 180,533 | 1.399x | Very Fast |
512x512 : 256 colors
| Format | Size (bytes) | Compression Ratio | Speed |
|---|---|---|---|
| PEP | 154,778 | 0.588x | Fast |
| PNG (max) | 184,219 | 0.700x | Very Slow |
| PNG (fast) | 195,130 | 0.741x | Faster |
| GIF | 221,165 | 0.840x | Faster |
| BMP | 263,222 | 1.00x | Very Fast |
| QOI | 457,978 | 1.739x | Very Fast |
pep is designed for games too, so the compression outputs a structure that has useful elements. The pep.data pointer ONLY contains the bytes for the pixels. This library doesn't have a BMP loader, so this is specifically designed for setups where the color bytes already exist. You just feed it into pep_compress() with the correct in_format of the bytes, and then you're able to use it however you like! Often you just use pep_save() after compressing, and then pep_load() + pep_decompress() to access the image data.
…Though a lot of this was bashed together with love and tweaked with brute-force, many underlying structures were inspired/referenced from these sources:
Please contribute to make PEP the best pixel art format there is!
-End :::.
No open issues yet, or sync has not completed.