png IDAT数据块还原问题
来源:互联网 发布:潭州教育python网盘 编辑:程序博客网 时间:2024/05/18 03:03
png由于fireworks生成的数再进一步处理,还原出来的数据还要计算下
这两天查遍了互联网,和无数次生成数据手工计算还原,希望找到个规律
从一篇提示想到手工猜测,我用php写了一个模板,枚举了很多种算法。直接显示结果
如果能还原出来跟fireworks看到的值一样说明民成功的。
这里有一个仁兄提问,他说是位运算
我后来发现是加减运算
http://tieba.baidu.com/f?kz=859640399
01 就是后面一个RGBA加上前边一个RGBA
02 就是下面原始数据加上上面解码出来的RGBA
04 在下面有说明
03 是前边一个字节加上上边对应一个字节然后除2 然后加上本字节 比如(前R+上R)/2+R(本字节R)
这个适合真彩情况,window画图生成的png并没有编码,直接放RRGGBBAA
我推理了一天才发现03这种情况 所以如果png IDAT 遇到真彩解码或编码问题可以多试下
行头为04数据格式
Table 1. Predictor states used for differential encoding in the PNG image format.
The Paeth filter computes a simple linear function of the three neighboring pixels (a, b, c), then
chooses as predictor the neighboring pixel closest to the computed value as defined by the
following pseudo-code:
// Input: color values a,b, and c as illustrated in Figure 3
// a = left, b = above, c = upper left
// Output: a paeth-prediction for a,b, and c
04方式求出X的伪代码
paeth_predict(a,b,c)
p := a+b-c
pa := abs(p-a)
pb := abs(p-b)
pc := abs(p-c)
IF (pa<=pb AND pa<=pc) p := a
ELSE IF (pb <= pc) p := b
ELSE p := c
paeth_predict := p
Compression of a pixel value x dependent on its neighbors a,b, and c works by calculating
compressed(x) = x - paeth_predict(a,b,c)
and decompression works by reversing the formula to
uncompressed(x) = compressed(x) + paeth_predict(a,b,c).
http://en.wikipedia.org/wiki/Portable_Network_Graphics
http://ngs.ics.uci.edu/teaching/winter2011/Multimedia/textbook/MM_Chapter_lossycomp_100220.pdf
具体看下面这里
http://www.w3.org/TR/PNG/#9Filters
- png IDAT数据块还原问题
- 解压缩PNG deflate压缩IDAT数据
- Encoding Web Shells in PNG IDAT chunks
- png数据块IHDR_IDAT_END读取
- 分析PNG图片格式——数据块
- iOS错误:<Error>: ImageIO: PNG IDAT: invalid stored block lengths
- <Error>: ImageIO: PNG invalid PNG file: iDOT doesn't point to valid IDAT chunk 解决
- <Error>: ImageIO: PNG invalid PNG file: iDOT doesn't point to valid IDAT chunk
- ImageIO: PNG invalid PNG file: iDOT doesn't point to valid IDAT chunk
- 反编译9.png图片还原
- app ipa还原png 脚本
- sqlite 更新数据后重启被还原的问题
- shrink合并数据块--解决数据块碎片问题
- PNG数据
- 数据还原
- 数据还原
- 数据还原
- 块匹配模型的还原
- ipd与敏捷的关系
- VC6.0编译器参数设置
- HDU 1237 前缀树
- HTC美国区总裁称iPhone没那么酷了
- 软件测试流程
- png IDAT数据块还原问题
- 论坛盖楼抽奖活动总结
- NeHe OpenGL教程 第五课 3D图形
- Macros for Build Commands and Properties
- 周围的人都考研去了
- oracle优化
- 软件可靠性
- 内存碎片
- 使用ErrorStack进行错误跟踪及诊断