I ran jpegtran on a bunch of images as such:
$ jpegtran -copy none -optimize
Most of them were reduced in size by a lot. But some of them actually increased in size. How can that be?
I ran jpegtran on a bunch of images as such:
$ jpegtran -copy none -optimize
Most of them were reduced in size by a lot. But some of them actually increased in size. How can that be?
The -optimize
flag will "Perform optimization of entropy encoding parameters" (directly take from the jpegtran
manual), which says nothing about the size of the result. If the source image file doesn't contain any comments or other "excess baggage" that is removed by -copy none
, then I see no reason why the file could not grow in size by a fraction.
jpegtrans
manual refers to the manual of cjpeg
for more info about the -optimize
flag. It says "-optimize
usually makes the JPEG file a little smaller". Although it actually mentions the size of the image, it definitely makes no promises. I think that the savings that you make from using the flag will be insignificant (or at least much smaller) than the savings that you make from removing EXIF tags etc. with -copy none
.
Commented
Jun 4, 2015 at 8:06
-optimize
without -copy none
and see which one contributed more to the savings I saw. By the way, you misspelled optimize
at the start of your post (you missed the "p").
Commented
Jun 6, 2015 at 0:31