Tested and working with macOS 10.13 High Sierra and later.
Set a macOS user's image from the command line.
./set-user-image.sh -h
./set-user-image.sh -u USER_TO_UPDATE -i IMAGE_FILE [-p] [-r]
Use ./set-user-image.sh -h
to see an explanation of the options and their usage.
Set the image for user miyuki
:
./set-user-image.sh -u miyuki -i images/giraffe.jpg -p -r