ImageMagick is a free and open-source software suite for displaying, creating, converting, modifying, and editing raster images. It can read and write over 200 image file formats.
sudo apt install -y imagemagick
convert <input> -type grayscale <output>
convert <input> -resize HHxWW <output>