Page 1 of 1

Feature suggestion: max. "-define jpeg:extent" (patch doesn't work)

Posted: 2015-02-21T09:44:27-07:00
by Marsu42
I don't know if you feel this is over the top, but for what it's worth I'd like to do IM internally what I'm currently doing scripted with multiple runs: When defining "-define jpeg:extent" imho what is of interest very often is not to go higher than a certain *maximal* size, not to have a *fixed* size.

Current behavior: With a batch of sample images and a certain quality, I end up between 700k and 2400k. In this example I'm setting "-define jpeg:extent=1500k". However, this results in a way too low compression for the images with good compressibility, essentially wasting space and bandwidth.

Suggested behavior: Define both "-define jpeg:extent=1500k" and "-quality xyz" in conjunction and let IM choose whatever comes out smallest.

Re: Feature suggestion: max. "-define jpeg:extent"

Posted: 2015-02-21T10:24:16-07:00
by magick
Download / install ImageMagick 6.9.0-8 Beta tomorrow. It has a patch to improve the results of the jpeg:extent define.

Re: Feature suggestion: max. "-define jpeg:extent"

Posted: 2015-02-22T16:04:05-07:00
by Marsu42
magick wrote:Download / install ImageMagick 6.9.0-8 Beta tomorrow. It has a patch to improve the results of the jpeg:extent define.
That's great news, IM gets my award for the most responsive oss team :-)

I'll have to wait until there are windows binaries to test the change, I'm done trying to compile IM myself with cygwin/mingw x64 as all these additional required libs for a full build are too much of a hassle for a casual compile.

Re: Feature suggestion: max. "-define jpeg:extent" (patch doesn't work)

Posted: 2015-03-06T09:43:02-07:00
by Marsu42
magick wrote:Download / install ImageMagick 6.9.0-8 Beta tomorrow. It has a patch to improve the results of the jpeg:extent define.
I now had the opportunity to test the new windows binary " ImageMagick 6.9.0-9 Q16 x64 2015-02-28", and unfortunately it doesn't work as intended. For example with two test files with same dimensions, but very different compressibility (bad.tif & good.tif) I've tried to run these commands:

a) "convert -quality 75" results in good.jpg=1mb, bad.jpg=6mb
b) "convert -quality 75 -define jpeg:extent=5000kb" results in *both* files being about 5mb

What I had in mind is that in case b) good.jpg should stay at 1mb, but "bad.jpg" should be clipped at 5mb (instead of 6) so that the combination of -quality and jpeg:extent behave like a "upper ceiling" option.

Am I doing something wrong, what does the patch you announced above actually do? Thanks for any insight!

Re: Feature suggestion: max. "-define jpeg:extent" (patch doesn't work)

Posted: 2015-03-06T12:47:28-07:00
by magick
We'll have a patch in ImageMagick 6.9.0-10 Beta by sometime tomorrow to address your suggestion.

Re: Feature suggestion: max. "-define jpeg:extent" (patch doesn't work)

Posted: 2015-03-07T17:56:26-07:00
by Marsu42
magick wrote:We'll have a patch in ImageMagick 6.9.0-10 Beta by sometime tomorrow to address your suggestion.
Thanks, it's working now :-)