mogrify -geometry x31 path/to/image.gif
mogrify is part of ImageMagick, an image manipulation software suitemogrify manipulates the specified images. If you prefer to keep the original image untouched and write the manipulated image to a different file, simply replace mogrify with convert, the syntax is the same, but the last command line argument will be the target image to write to.-geometry flag is to resize the image, it requires a dimension parameter in the format WIDTHxHEIGHTImageMagick is not a standard package, though it is open source and available in many systems.