It looks like the relative ordering of modifier arguments (-quality NN) and filenames does matter here, almost like it's doing what it's told in a very, very simplistic way.
: cez@rhk; !ls
ls -lh Screenshot.jpg
-rw-r--r-- 1 cez staff 1.3M 5 24 19:20 Screenshot.jpg
: cez@rhk; mogrify -verbose -monitor -compress JPEG Screenshot.jpg -quality 10
load image[Screenshot.jpg]: 1079 of 1080, 100% complete
Screenshot.jpg JPEG 1920x1080 1920x1080+0+0 8-bit DirectClass 1.335MB 0.120u 0:05.680
save image[Screenshot.jpg]: 1079 of 1080, 100% complete
Screenshot.jpg JPEG 1920x1080 1920x1080+0+0 8-bit DirectClass 1.327MB 0.240u 0:02.960
: cez@rhk;
So, the first time we run mogrify, we specify the -quality
argument after the filename, and so it doesn't know that the quality specifier should apply to that image.
: cez@rhk;mogrify -verbose -monitor -compress JPEG -quality 85 Screenshot.jpg
load image[Screenshot.jpg]: 1079 of 1080, 100% complete
Screenshot.jpg JPEG 1920x1080 1920x1080+0+0 8-bit DirectClass 1.341MB 0.100u 0:00.119
save image[Screenshot.jpg]: 1079 of 1080, 100% complete
Screenshot.jpg JPEG 1920x1080 1920x1080+0+0 8-bit DirectClass 459KB 0.190u 0:00.200
: cez@rhk;
Conversely, if we specify the quality setting before the image filename, it'll save the image with more compression, reducing the filesize.
convert image.png \( +clone -quality 85 -write image.jpg +delete \) -quality 50 -resize x200 image_thumb.jpg
to convert a PNG file to an 85%-quality JPEG and a 50%-quality thumbnail all in one go. That's why argument order matters. – FeRD Jun 05 '18 at 12:02