<?phpheader('Content-Type: image/png');passthru( "convert marker.png \( -define jpeg:size=200x200 face.png -thumbnail 31x31^ -gravity center -extent 31x31 \( +clone -threshold -1 -negate -fill white -draw 'circle 15,12 12,0' \) -alpha off -compose copy_opacity -composite \) -geometry +0-7 -compose over -composite png:-" );?>
(Yes, it really is that simple - just call the php file and the image appears - image magick !!)
The image generated retains the same dimensions as the original marker: 31x51 pixels
Plenty more to do on this: the upload, saving and downloading of image files, adjustment to script to accept parameters, getting users to take selfies with their face in the middle of the picture!, deciding how the images can be reused once created....
"", then the default marker icon will be used.