Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I know that there is 'jpegoptim' to do so. But it not always downsize images as expected. For example if I execute

jpegoptim --max=50 *.jpg

on a 550KB image, the size will not really reduce. So I am wondering if there are some more efficient tools to do so.

Thanks

share|improve this question
up vote 10 down vote accepted

You could try mogrify:

http://www.imagemagick.org/www/mogrify.html

Also see specific examples for image compression:

http://askubuntu.com/questions/25356/decrease-filesize-when-resizing-with-mogrify

mogrify -quality 80 -resize 80 file.jpg

so you should end up with something like

mogrify -quality 80 file.jpg

Test from my machine:

aaron@sandbox:~/img-test$ du -h splash.jpg 
188K    splash.jpg
aaron@sandbox:~/img-test$ mogrify -quality 10 splash.jpg
aaron@sandbox:~/img-test$ du -h splash.jpg 
16K splash.jpg

At 10% this looks terrible, but you get the idea.

You could also use Python's PIL:

http://stackoverflow.com/questions/4353019/in-pythons-pil-how-do-i-change-the-quality-of-an-image

from PIL import Image

im = Image.open("C:\Users\Public\Pictures\Sample Pictures\Jellyfish.jpg") im.save("C:\Users\Public\Pictures\Sample Pictures\Jellyfish_compressed.jpg", quality=10)

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .