jpeg:extent bug?
Posted: 2010-02-11T11:34:17-07:00
I've found some strange behaviour when trying to use jpeg:extent in the windows (6.5.9-3) build of IM
For example, with an image 1024x1024px:
This often results in an image file with the equivalent file size greater than 400kB. (421k in this case - the same size as -quality 100% in fact. Some other images resulted in even bigger file sizes)
For the 2048x2048px source of the above image (also .png - resized for the above), jpeg:extent=400kB results in a file of 398kB, which is what I would expect.
Various IM quality settings:
100 ~= 421k
99 ~= 332k
90 ~= 140k
80 ~= 70k
for 2048x2048:
100 ~= 1.18MB
94 ~= 433k
93 ~= 398k
For a different image (also 1024x1024):
-quality 100% = 464k
99% = 372k
98% and jpeg:extent=400kB gives 298k
For this one, the result is below the threshold, but is also not the best quality for it.
I couldn't find the relevant code in the source, so I haven't got any specific ideas about what's causing it.
For example, with an image 1024x1024px:
Code: Select all
convert image.png -define jpeg:extent=400kB image.jpg
For the 2048x2048px source of the above image (also .png - resized for the above), jpeg:extent=400kB results in a file of 398kB, which is what I would expect.
Various IM quality settings:
100 ~= 421k
99 ~= 332k
90 ~= 140k
80 ~= 70k
for 2048x2048:
100 ~= 1.18MB
94 ~= 433k
93 ~= 398k
For a different image (also 1024x1024):
-quality 100% = 464k
99% = 372k
98% and jpeg:extent=400kB gives 298k
For this one, the result is below the threshold, but is also not the best quality for it.
I couldn't find the relevant code in the source, so I haven't got any specific ideas about what's causing it.