Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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 love the command line options of imagemagick. Mogrify is great to resize images and change quality, which is what I use most often. However, I have noted that the filesize if often larger than what it should be. Especially with small images. For instance, I have a regular 640px (width) photo, which I change to quality 80 and a width of 80px:

mogrify -quality 80 -resize 80 file.jpg

Works well and my image gets resized and the quality is changed to 80. However, the filesize is around 40Kb. For such a tiny image, that is huge! When I use mtPaint, and open the file and save it (not changing anything, just CTRL+O, CTRL+S), the filesize decreases with more than 95% to less than 2Kb! I have seen this is often the case.

What goes wrong?

share|improve this question
See what identify file.jpg (another imagemagick command) says before and after using mogrify. May provide some clues. – geirha Feb 8 '11 at 23:54
Try giving size with apostrophe like -resize '80' – Takkat Feb 9 '11 at 7:58
up vote 6 down vote accepted

I found the answer... it was in the "metadata"! Apparently this easily weighs about 18 Kb per image, so in the original you might not note this, but in the tiny resize it means 18 Kb + 2 Kb = 20 Kb total filesize. They significantly increased by doing:

mogrify -strip file.jpg

share|improve this answer

Your Answer


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