3 ms·
FWIW, binary pbm is a good format for these sort of images. Heres a script to make one from /dev/urandom. Use something.pbm as the file name. size is in octe
by emmelaich 5y ago
FWIW, binary pbm is a good format for these sort of images.
Heres a script to make one from /dev/urandom. Use something.pbm as the file name. size is in octets.
case $# in
1) file="$1"; size="100";;
2) file="$1"; size="$2";;
*) echo >&2 'Usage ... file [size]'; exit 2;;
esac
(echo 'P4
# random.pbm
'
echo $size $size
dd if=/dev/urandom bs=8 count=$((size * size))
) > "$file"