Skip to content

Instantly share code, notes, and snippets.

@Mika-
Created February 11, 2015 15:26
Show Gist options
  • Save Mika-/185c8d777aab3ebba548 to your computer and use it in GitHub Desktop.
Save Mika-/185c8d777aab3ebba548 to your computer and use it in GitHub Desktop.
Resize and convert image to web optimized jpg with imagemagick and mozjpeg
convert source.png -resize 1920x1080 -background white -flatten TGA:- | cjpeg -quality 90 -targa -outfile compressed.jpg
@FossPrime
Copy link

FossPrime commented Jun 5, 2017

tried convert source.png -sampling-factor 4:2:0 -strip -colorspace RGB TGA:- | cjpeg -quality 85 -targa -outfile ugly5.jpg pagespeed still won't like it as libpng will throw some artifacts and get it down from 20.7kB to 18.1kb, over 10%, which is pagespeed's warning threshold.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment