I am looking for an algorithm that adds borders to a bitmap image(very much like the photoshop stroke effect) but one that will also have antialiasing to the borders(or one that copies alpha from the original bitmap to make the border look antialiased).
If you can't answer with an algorithm a direction of creating one myself would be great.
*****Update***
The part coloured black is the original ellipse and the part coloured green is the stroke.
The stroke is basically adding a contour to the bitmap or edges.