Continuing the idea of using a server with imagemagick....
This is work in progress, but an example of what can be done. You will need an external server running php and imagemagick to do this
Create a php file for the server. In my example below I have hard coded the "marker" image and the "face" image which I uploaded to the server. The "face" images can be uploaded on the fly. The php would probably need to save each file sent for AI2 to use individually, but in my case here I have simply generated a file that can be called directly by an image or marker component.
The imagemagick command grabs the center square of any image and then makes it a circular image. This is then composited onto the marker image. I used png as the image format to allow it to be shown as an image picture. The marker should be able to handle an svg.
I have imagemagick guru Fred Weinhaus
to thank for his help on making the convert command a one liner
PHP file example:
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....