6 ms·
Anyone have more details on exactly what cjpeg does? What sets this apart from a solution like JPEGoptim?
by maerek 12y ago
Anyone have more details on exactly what cjpeg does? What sets this apart from a solution like JPEGoptim?
- sp332 12y agoMozilla recently improved the JPEG encoder. They claim 5% smaller files then libjpeg-turbo. https://news.ycombinator.com/item?id=8036959 https://news.ycombinator.com/item?id=8036959
- joshmoz 12y ago"cjpeg" is the basic command-line tool for making use of the mozjpeg library to create JPEG images. libjpeg-turbo and IJG JPEG libraries also have "cjpeg" tools as their basic command-line encoder. The tool for mozjpeg works almost exactly the same way, but it has some extra option flags, can take JPEG input (the others can't), and re-defines the "-baseline" option to something more intuitive (see v2.1 release notes).
- coob 12y agoI've not seen significant ( > ~1%) improvement over jpegoptim.
- pornel 12y agojpegoptim optimizes Huffman tables. Mozjpeg's cjpeg always does it, plus: * jpegcrush/jpegrescan trick: tweaks details of progressive JPEG for maximum compression (each scan gets its own Huffman table, and JPEG can arbitrarily divide data into scans). That's 5%-10% improvement over jpegoptim. * if you're creating a new JPEG or lowering quality of an existing one, then it uses trellis quantization. In the lossy compression step instead of naively throwing away data, it evaluates lots of combinations to find best bang-for-the-buck combination. That's an extra 5% improvement in quality/filesize ratio.