billfeller.github.io icon indicating copy to clipboard operation
billfeller.github.io copied to clipboard

Baseline vs. progressive JPEGs

Open billfeller opened this issue 7 years ago • 0 comments

  1. 渲染普通的Baseline类型JPEG是从上到下的。
  2. 渲染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

  1. use -flatten
  2. use -mosiac
  3. use image indexing

billfeller avatar May 31 '17 05:05 billfeller