billfeller.github.io
billfeller.github.io copied to clipboard
Baseline vs. progressive JPEGs
- 渲染普通的Baseline类型JPEG是从上到下的。
- 渲染Progressive类型JPEG是渐进式的,在整个图片还没有加载完,就可以显示整个轮廓,逐渐变清晰,直到最后整张图片渲染完成。
可以使用 imagemagick 查看图片是否渐进式的,如下:
$ /usr/local/imagemagick/bin/identify -verbose baseline.jpg | grep Interlace
Interlace: None
使用Imagemagick转换Baseline JPEG为Progressive JPEG
$ /usr/local/imagemagick/bin/convert -interlace plane baseline.jpg progressive.jpg
$ /usr/local/imagemagick/bin/identify -verbose progressive.jpg | grep Interlace
Interlace: JPEG
取gif图指定帧生成预览图:
$ /usr/local/imagemagick/bin/convert -interlace plane a.gif[0] a.jpg
$ /usr/local/imagemagick/bin/identify -verbose a.jpg | grep Interlace
Interlace: JPEG
TODO: how to Convert animated GIF to single JPEG
- use -flatten
- use -mosiac
- use image indexing