Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

1 Answer

up vote 9 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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.