You can create an alpha mask for a particular channel of an image. In the following case, agg::alpha_mask_rgba32a uses the alpha channel. It is possible to use agg::alpha_mask_rgba32r for red channel, and so on.
To hook things up, one basically create an alpha mask pixel format (AMPixelFormat below) that wraps around the original pixel format with the alpha mask.
The image icon's alpha channel being drawn as gray using the alpha channel.
The image icon's alpha channel being drawn as gray using the alpha channel and then blurred.
The image icon's alpha channel being drawn as gray using the alpha channel at an dx = 5, dy = 5 offset, then blurred. Then the original image icon was drawn on top. Effectively it creates a gray shadow effect.