One option is sfjpg2byte. It requires the JPEG library to be present at the compilation time.
Another option (suggested by Vladimir Bashkardin) is to use the convert utility from ImageMagick.
< lena.jpg convert - lena.gray echo in=lena.gray data_format=native_uchar n1=512 n2=512 | sfdd type=float > lena.rsf
or
code
more code
~~~~