百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
P

pep

> 编程语言
开源

Prediction-Encoded Pixels - 这是一种小巧而强大的单头像素艺术压缩方法,其重点是大小

367 stars0 点赞2 次浏览
访问官网GitHub

工具介绍

Prediction-Encoded Pixels - 这是一种小巧而强大的单头像素艺术压缩方法,其重点是大小

Prediction-Encoded Pixels

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.

tree1

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

font

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

nz_scene

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

baboon

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

Mini-documentation:

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.

…

References

Though a lot of this was bashed together with love and tweaked with brute-force, many underlying structures were inspired/referenced from these sources:

  1. Wikipedia: Prediction by Partial Matching.
  2. Cleary, J. G., & Witten, I. H. (1984): Data compression using adaptive coding and partial string matching. IEEE Transactions on Communications, 32(4), 396-402.
  3. Moffat, A. (1990): Implementing the PPM data compression scheme. IEEE Transactions on Communications, 38(11), 1917-1921.
  4. Cleary, J. G., Teahan, W. J., & Witten, I. H. (1995): Unbounded length contexts for PPM. Proceedings DCC-95, IEEE Computer Society Press, 52-61.
  5. Shkarin, D. (2002): PPM: One step to practicality. Proceedings of Data Compression Conference 2002, 202-211.

Please contribute to make PEP the best pixel art format there is!

-End :::.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Cccompressionimage-compressionpixel-art

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言