In that case I would suggest implementing a a small little edge detection by running a matrix filter operation.
not tested code for it would be
' assuming pix holds the pixmap
' assuming that maskColor holds the ARGB value of the "to cut color"
' assuming borderColor holds the color for the border / outline
local pw:int = pixmapwidth(pix) - 1
local ph:int = pixmapheight(pix) - 1
for local x:int = 0 to pw
for local y:int = 0 to ph
local pixel:int = 0
for local i:int = max(x-radius,0) to min(x+radius, pw)
for local j:int = max(y-radius,0) to min(y+radius, ph)
pixel :+ readpixel(pix,x+i, y+j)
next
next
pixel :/ int(radius*radius)
if( pixel <> maskColor )
writepixel(pix, x, y, borderColor)
else
writepixel(pix, x, y, maskColor)
endif
next
next
this uses a square combination ... you could reduce it to do it only if i + j <= radius so you get a "rounder" shape that collects the data for the outline.
There are other, quite optimized algorithms for that, so having a look at those might actually be an idea if it is too slow :)