Optimize images for web in one line using ImageMagick

2022-09-28

Change the quality depending on your needs:

convert -strip -interlace Plane -colorspace RGB -sampling-factor 4:2:0 -gaussian-blur 0.05 -quality 30% input.jpg output.jpg

30% would be enough for background images and thumbs.

60-70% would be optimal for fullsize images used in galleries, etc.