Hi,
It would be great if ImageMagick could losslessly reduce the size of a JPEG by optimizing the Huffman tables. Same as the command line tools jpegtran and jpegoptim, or online tools such as smush.it or kraken.io.
Check this website for more information: http://www.impulseadventure.com/photo/o ... -jpeg.html
I am looking to include the optimization in an image upload/resize process for a photo gallery framework, which already uses ImageMagick. For me none of these tools are satisfactory, the command line tools are often not available on hosting accounts and the online tools have a file size limit of 1 MB.
Cheers, Robert
Feature Request: Optimize JPEG Huffman Tables
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Feature Request: Optimize JPEG Huffman Tables
I believe that IM relies upon the libjpeg delegate library for any jpg processing. So it is really out of the hands of the IM developers and a question for the libjpeg developers. However, I will defer to the IM developers for final comments and any corrections to my statement.
Re: Feature Request: Optimize JPEG Huffman Tables
The libjpeg delegate libraries allows you to define Huffman tables so it can be done-- its always a question of time. We don't have any. For this enhancement we will need to depend on a user contribution or it will need to wait until ImageMagick 7 is complete in about 1 year.
Re: Feature Request: Optimize JPEG Huffman Tables
Hi,
Just found something in the documentation that says that the Huffman optimization is already done in Imagemagick:
http://www.imagemagick.org/script/formats.php
Am I confusing something here?
Cheers, Robert
Just found something in the documentation that says that the Huffman optimization is already done in Imagemagick:
http://www.imagemagick.org/script/formats.php
Am I confusing something here?
Cheers, Robert
Re: Feature Request: Optimize JPEG Huffman Tables
If you set the optimize-coding define it causes the compression to compute optimal Huffman coding tables for the image. In most cases optimal tables save only a few percent of file size compared to the default tables.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Feature Request: Optimize JPEG Huffman Tables
I have updated this define in IM examples, JPEG writing options...
http://www.imagemagick.org/Usage/formats/#jpg_write
Thanks for the extra details.
However what is the default setting for the "jpeg:optimize-coding" define?
The above implies that optimal huffman tables are off by default, and need set 'true' to turn on
While the Formats page implies that it is on by default and you need to set 'false' to turn it off.
http://www.imagemagick.org/Usage/formats/#jpg_write
Thanks for the extra details.
However what is the default setting for the "jpeg:optimize-coding" define?
The above implies that optimal huffman tables are off by default, and need set 'true' to turn on
While the Formats page implies that it is on by default and you need to set 'false' to turn it off.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: Feature Request: Optimize JPEG Huffman Tables
Optimal coding is off by default because it requires an extra pass over the image slowing compression.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Feature Request: Optimize JPEG Huffman Tables
Thanks. I have updated IM examples JPEG Writing Control Options appropriately.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: Feature Request: Optimize JPEG Huffman Tables
Guys,
Since which version is it off by default? Just tested with 6.6.6, and here optimize-coding=true produces the same file size as if omitting the parameter, while optimize-coding=false produces a slightly larger file (85KB instead of 83KB).
Cheers, Robert
Since which version is it off by default? Just tested with 6.6.6, and here optimize-coding=true produces the same file size as if omitting the parameter, while optimize-coding=false produces a slightly larger file (85KB instead of 83KB).
Cheers, Robert