Convert the image to grayscale

jpegtran

jpegtran -grayscale {{path/to/image.jpg}} > {{path/to/output.jpg}}

click the source code to copy install jpegtran on any operating system with command-not-found.com