try the following
you have to resize the big image to the size of the small image, you have to create as grayscale mask from the small image and invert (-negate) the black and white, and flood fill the outside of the mask with white. Then you delete the big image and composite the others together.
dim=`convert ura.jpg -format "%wx%h" info:`
convert slika.jpg ura.jpg \
\( -clone 0 -resize $dim! \) \
\( -clone 1 -colorspace gray -negate -fuzz 10% -fill white -draw "color 0,0 floodfill" \) \
-delete 0 -swap 0,1 -compose over -composite result.jpg
Actually, the above still needs a little work as the numerals are not outlined. I will try to fix this later, though not sure exactly when. So anyone else is welcome to improve it.
see
http://www.imagemagick.org/script/escape.php
http://www.imagemagick.org/script/comma ... colorspace
http://www.imagemagick.org/Usage/basics/#parenthesis
http://www.imagemagick.org/Usage/compose/#compose
http://www.imagemagick.org/Usage/layers/#convert
http://www.imagemagick.org/Usage/draw/#color