Last active
March 7, 2019 19:04
-
-
Save ahsquared/f84157c82161bd178738db873bcd1886 to your computer and use it in GitHub Desktop.
Compress JPG with ImageMagick
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
convert -strip -interlace Plane -sampling-factor 4:2:0 -define jpeg:dct-method=float -quality 70% source.jpg output.jpg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
From: http://stackoverflow.com/questions/7261855/recommendation-for-compressing-jpg-files-with-imagemagick
From @Fordi in the comments (don't forget to thumbs up his comment if you like): If you dislike blurring, use -sampling-factor 4:2:0 instead. What this does is reduce the chroma channel's resolution to half, without messing with the luminance resolution that your eyes latch onto. If you want better fidelity in the conversion, you can get a slight improvement without an increase in filesize by specifying -define jpeg:dct-method=float - that is, use the more accurate floating point discrete cosine transform, rather than the default fast integer version.