2
I'm currently using mogrify -strip image.jpg
to remove unwanted bytes from images, it was suggested I could remove further data by using jpegran
from libjpeg
, something like:
jpegtran -copy none -optimize -outfile image.jpg image.jpg
The problem I'm having – if it even is a problem – is that jpegtran
doesn't seem to actually do anything that mogrify isn't already doing. In all my testing the filesize just stays the same. If I remove the mogrify part of my code and replace with jpegtran
then it seems to perform the same function.
For example:
- image without compression: 300k
- image with
mogrify -strip
+jpegtran
: 272k - image with
mogrify -strip
only: 272k - image with
jpegtran
only: 272k
I was under the impression though that mogrify
just removed image profiles/comments and that jpegtran
did this as well as losslessly compressing the image to make it smaller. Am I missing something?
i would assume that too, but it seems unlikely given i've tried images from various sources (digital camera/iPhone/web) and found the results to be the same – robjmills – 2011-08-23T15:33:09.210
1
confirmed here http://www.imagemagick.org/script/formats.php "By default we compute optimal Huffman coding tables"
– robjmills – 2011-08-24T10:29:12.237