Creating a Gold Coin

Look around the Graphics Lab

These are the steps I used to create a gold coin with an embossed faerie dragon image (see right) on it. The tools used were XV X Windows Image Viewer and Editor, ImageMagick Image Filters, and GifTrans for setting transparencies.

[image] dragon1.gif: Original image rescaled and gray scaled

[image] dragon2.gif: The image is resized to provide space for the coin edge.

Also to allow the image to emboss better the gray scale warped so solid black is the same as the background and the insides of the figure darkened. On an different image, it may have been better for me to have flood filled the background to the same color as the border.

Border outlines are often the reason a image fails to emboss nicely as it produces a `ridge' along the edge of the image instead of a smooth indentation over the whole image.

[image] dragon3.gif: Coin edge circle made with

    convert -pen '#000' -draw 'circle 50,50 60,90' dragon2.gif dragon3.gif
    convert -pen '#FFF' -draw 'circle 50,50 60,87' dragon3.gif dragon3.gif

[image] dragon4.gif: edge added using
    combine -compose bumpmap dragon2.gif dragon3.gif dragon4.gif
NOTE: Imagemagick combine did not have a grayscale multiply!
Is their a better way?

[image] dragon5.gif: XV embossed and, gray scale inverted, Note this should probably have also been smoothed within XV at this point to make a cleaner image. But I forgot to do this, and it has to be done before the next step to give a good sharp transparent edge.

[image] dragon5_im.gif: ImageMagick embossed and then inverted with XV. Look at the image noise under the tail, and the IM emboss is not as smooth as the XV emboss, the pure black and white also makes it difficult to color modify latter.

[image] dragon6.gif: Draw a circle mask one pixel larger then the coin edge ring, using
    convert -pen '#000' -draw 'circle 50,50 60,91' dragon3.gif dragon6.gif
The outside color (to make transparent) is then set, while the inside of the transparency mask is made transparent. This is the reverse transparency to what will be in the final image.

[image] dragon7.gif: Masked emboss to add a non-greyscale color for transparency
    combine -compose over dragon5.gif dragon6.gif dragon7.gif

[image] gold_dragon.gif: Final image with grayscale colored gold (lots of XV color editing) and mask color set to transparent using giftrans.

NOTE: re-coloring could also have need performed immediately after the embossing, and in fact is probably better done at that stage.

[image] gold_dragon_edge.gif: Example of further processing using XV. Coin rotated 30 degrees clock-wise, height shunk to 40% of original height, and image smoothed before saving. All that is now needed is to clean the image edges for transparency and to give the coin a bit of thickness.

NOTE: Any other rotation does not seem to work as the shadows become wrong. For other rotations, the image will have to be rotated first, embossed, and then the rest of the above steps applied.

XV does not have a `matte' channel as such after the above processing the image edges have been anti-aliased into the transparency color (Bad move). To avoid this you should keep the mask separate to the image, processing in a simular way, masking only as the final step.

As ImageMagick does have a `matte' or transparent image channel it may do the above processing better, retaining the mask without this anti-aliasing between the image and the transparency.

Picking a mask color which is the same as the final background of the image would have mean you would not have to worry about this anti-aliasing effect but would produce a `shadow' around the image on any other background color, or no transpareny mask at all.

Update if you create a X bitmap of the transparency color a new option to ImageMagick "convert" command will now let you ues it as a transparency mask using a command like...

    combine -compose ReplaceMatte dragon3.gif mask.xbm dragon6.gif

Imagemagick also allows `opaque transparency' (matte channel) with partical transpency (use the above with a shaded mask image), but the GIF format does not! Formats which allow partical transparency include MIFF, TIFF, or PNG.

Created: 16 February 1997
Updated: 14 May 1998
Author: Anthony Thyssen, <anthony@cit.gu.edu.au>
URL: http://www.cit.gu.edu.au/~anthony/graphics/coin/