Decrease filesize when resizing with mogrify
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?
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