ID:257775
 
I have two procedures here. Outline(), and InnerOutline(). Both procedures have the option to pass a color for the new outline, otherwise it will simply be black. Outline() also has a "strong" argument that will make the outline a little stronger. These will both return a new icon that will contain only the outline of the icon running the procedure. From there, you can add it as an overlay, Blend() it, etcetera.

//Title: Icon Outlining
//Credit to: Hiro the Dragon King


icon/proc/Outline(color,strong)
if(!findtext(color,"#")) color="#000000FF"
var{w;h;icon/i=new(src)}
i.DrawBox(null,1,1,i.Width(),i.Height())
for(w=Width(), w>0, w--)
sleep(-1)
for(h=Height(), h>0, h--)
sleep(-1)
if(!GetPixel(w,h) && ((strong && (GetPixel(w-1,h-1)||GetPixel(w+1,h-1)||GetPixel(w-1,h+1)||GetPixel(w+1,h+1))) || (GetPixel(w-1,h)||GetPixel(w+1,h)||GetPixel(w,h-1)||GetPixel(w,h+1))))
i.DrawBox(color,w,h)
return i

icon/proc/InnerOutline(color)
if(!findtext(color,"#")) color="#000000FF"
var{w;h;icon/i=new(src)}
i.DrawBox(null,1,1,i.Width(),i.Height())
for(w=Width(), w>0, w--)
for(h=Height(), h>0, h--)
if(GetPixel(w,h) && (!GetPixel(w-1,h) || !GetPixel(w+1,h) || !GetPixel(w,h-1) || !GetPixel(w,h+1)))
i.DrawBox(color,w,h)
return i