For creating of self framed picture you can find a description in the usage pages of ImageMagick

look here



I had improved the first example bit and put everything in a script "selfframe" so that I can apply it easyly on a picture. You find the script at the bottom.

The script is called with one parameter, the name of the picture. It uses only one convert command which does the following:

  1. load the picture
  2. clone it (make a copy in a "layer").This is the underlying frame-picture.
  3. resize the layer by 30%
  4. adjust the color with +level
  5. blur the layer
  6. add a black border around the image
  7. clone the original image again, This is the original picture on top of the frame-picture.
  8. draw a border raound this image
  9. delete the original image because it is not used anymore.
  10. center then images above each other and composite them
  11. save the picture with a prefix sf_ to the filename

You can do some more adjustments to the underlying frame. For example you could convert it to b/w with -modulate 100,0,100 before adding the border or blur it several times.

Here comes the script:

#!/bin/bash
# selfframe
# creating a self framed picture

DEBUG="ON"
PICTURE="$1"
PDIR=`dirname ${PICTURE}`
PNAME=`basename ${PICTURE}`

if [ $DEBUG = "ON" ]
then
	echo "Picture=${PICTURE}"
	echo "PDIR=${PDIR}"
	echo "PNAME=${PNAME}"

fi 
convert ${PICTURE}  \
	\( -clone 0 -resize 130% +level 20%x100% \
	-blur 0x20 -bordercolor black -border 10x10 \) \
	\( -clone 0 -bordercolor black -border 10x10 \) \
	-delete 0 -gravity center -composite "$PDIR/sf_${PNAME}"