Firstly, you need to feed display RGB:-
raw bytes, not an encoded hex string like you're building with that hexdump | sed | tr
pipeline.
Secondly, you aren't giving it enough bytes: you need 3 bytes per pixel, one for each colour channel.
This does what you want:
mx=320;my=256;head -c "$((3*mx*my))" /dev/urandom | display -depth 8 -size "${mx}x${my}" RGB:-
To save directly to PNG, you can do this:
mx=320;my=256;head -c "$((3*mx*my))" /dev/urandom | convert -depth 8 -size "${mx}x${my}" RGB:- random.png
Here's a typical output image:
If you'd like to make an animation, there's no need to create and save individual frames. You can feed a raw byte stream straight to ffmpeg / avconv, eg
mx=320; my=256; nframes=100; dd if=/dev/urandom bs="$((mx*my*3))" count="$nframes" | avconv -r 25 -s "${mx}x${my}" -f rawvideo -pix_fmt rgb24 -i - random.mp4