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.


share|improve this question
up vote 10 down vote accepted

You could try mogrify:

Also see specific examples for image compression:

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:

from PIL import Image

im ="C:\Users\Public\Pictures\Sample Pictures\Jellyfish.jpg")"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 .