0

I have several hundred images I need to optimise and compress. I have found the following script on github: https://gist.github.com/ryansully/1720244 which works ok. However the filesizes of the jpgs are not much smaller after compression.

For example, one file before compression is 870.24 KB, after it is 724.97 KB. But, if I run the same image through compressjpg.com it reduces the filesize to around 290 KB.

How can I achieve this level of compression with jpegtran? Is it even possible?

MP_Webby
  • 916
  • 1
  • 11
  • 35
  • Why not use ImageMagick and get whatever output size you want? What are you trying to achieve overall - disk is really cheap.... – Mark Setchell Jan 01 '16 at 16:58
  • @MarkSetchell. I've already used Imagick to resize images so got that covered. I was more interested in removing EXIF data etc to reduce filesize even further. Basically whatever they are doing at compressjpg.com – MP_Webby Jan 01 '16 at 17:11
  • `mogrify -strip *.jpg` will remove EXIF data - try it on a copy of your files first. You can also specify the desired output filesize if you want to. – Mark Setchell Jan 01 '16 at 17:23
  • Regarding setting the output filesize: `convert original.jpeg -define jpeg:extent=300kb output.jpg` [from this post](http://stackoverflow.com/questions/6917219/imagemagick-scale-jpeg-image-with-a-maximum-file-size) – Chris O Jan 01 '16 at 18:08

0 Answers0