I am trying to run a program which has the following requirement:
This program reads in an uncompressed gray-scale image with one byte per pixel and a size of 256*256 pixels (no image header)
How do I convert a jpg
image to fit the above requirements.
With ImageMagick at the command-line:
magick input.jpg -resize 256x256\! -depth 8 -colorspace gray GRAY:image.raw
ImageMagick is included in most Linux distros and is available for macOS and Windows. In versions 6 and earlier, change magick
to convert
in above command.