我想知道在 PNG 图像中使用多个 IDAT-Chunk 的好处是什么。
PNG 文档说
There may be multiple IDAT chunks; if so, they shall appear consecutively with no other intervening chunks. The compressed datastream is then the concatenation of the contents of the data fields of all the IDAT chunks.
我无法想象这是因为块内数据块的最大大小(2^32 字节)。
最佳答案
回想一下,所有 PNG 块(包括 IDAT 块)都有一个带块长度的前缀。将所有压缩流放在一个巨大的 IDAT 块中会导致以下两个不便:
考虑到这一点,我认为应该推荐使用较小的 IDAT 块(例如 16KB 或 64KB)。开销(每块 12 字节,如果 len=64KB,则小于 1/5000)可以忽略不计。
关于PNG:使用多个 IDAT-Chunk 有什么好处?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29513549/