Meh the bevel effect available in most image editing programs (except pdn)
This effect will be under the menu Effects->Renders
Primary color = highlight
Secondary color = shadow
Example:
Ash's tiger:

->
A few buttons on Ash's siggie:
dll:
http://jason.jjtchiu.com/downloads/Bevel_v1.4.0.0.dll
source:
Code:
int Amount1=7; //[0,200]Depth
int Amount2=20; //[0,100]Strength
void Render(Surface dst, Surface src, Rectangle rect)
{
PdnRegion selectionRegion = EnvironmentParameters.GetSelection(src.Bounds);
// Delete any of these lines you don't need
Rectangle selection = this.EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt();
long CenterX = (long)(((selection.Right - selection.Left) / 2)+selection.Left);
long CenterY = (long)(((selection.Bottom - selection.Top) / 2)+selection.Top);
int left = (int)selection.Left;
int top = (int)selection.Top;
int right = (int)selection.Right;
int bottom = (int)selection.Bottom;
ColorBgra PrimaryColor = (ColorBgra)EnvironmentParameters.PrimaryColor;
ColorBgra SecondaryColor = (ColorBgra)EnvironmentParameters.SecondaryColor;
int BrushWidth = (int)EnvironmentParameters.BrushWidth;
ColorBgra CurrentPixel;
for(int y = rect.Top; y < rect.Bottom; y++)
{
for (int x = rect.Left; x < rect.Right; x++)
{
if (selectionRegion.IsVisible(x, y))
{
CurrentPixel = src[x,y];
//top
if ((x-left) >= (y-top) && (y-top) <= Amount1 && x+(y-top) < right)
{
CurrentPixel = transformPixel(y-top, CurrentPixel, PrimaryColor);
}
//left
else if ((y-top) >= (x-left) && (x-left) <= Amount1 && (x-left)+y < bottom)
{
CurrentPixel = transformPixel(x-left, CurrentPixel, PrimaryColor);
}
//bottom
else if ((x-left) >= (bottom-y) && (bottom-y) <= Amount1 && x+(bottom-y) <= right)
{
CurrentPixel = transformPixel(bottom-y, CurrentPixel, SecondaryColor);
}
//right
else if ((y-top) >= (right-x) && (right-x) <= Amount1 && (right-x)+y < bottom)
{
CurrentPixel = transformPixel(right-x, CurrentPixel, SecondaryColor);
}
dst[x,y] = CurrentPixel;
}
}
}
}
ColorBgra transformPixel(float px_from_edge, ColorBgra CurrentPixel, ColorBgra NewColor)
{
//set amount of background interference 0~1 (ie how much it blends to the background)
float diff = (float)(0.05 + px_from_edge/Amount1);
float strength = (float)((float)(100 - Amount2) / 100 + (float)0.35);
diff = diff * strength;
if (diff > 1)
{
diff = 1;
}
else if (diff < 0)
{
diff = 0;
}
//some vars just for convenience, more readable
float div = diff + 1;
float invrt_diff = 1 - diff;
//we set the RGB to primary color if it is completely transparent (black is the default)
//That should solve
if (CurrentPixel.A == 0)
{
CurrentPixel.R = NewColor.R;
CurrentPixel.G = NewColor.G;
CurrentPixel.B = NewColor.B;
}
//and we are ready to color the pixels
//ex: if 70% background interference
//we have 70% of original color's R plus 30% of the new color's R
CurrentPixel.R = (byte)((invrt_diff * (float)NewColor.R) + (diff * (float)CurrentPixel.R));
CurrentPixel.G = (byte)((invrt_diff * (float)NewColor.G) + (diff * (float)CurrentPixel.G));
CurrentPixel.B = (byte)((invrt_diff * (float)NewColor.B) + (diff * (float)CurrentPixel.B));
//transparency values need special manipulation to prevent bad-looking renders
float temp = CurrentPixel.A + NewColor.A;
if (temp > 255)
{
temp = 255;
}
temp = ((int)CurrentPixel.A + temp) / 2;
if (CurrentPixel.A < 255)
{
temp = temp * (1 + (float)invrt_diff);
}
if (temp > 255)
{
temp = 255;
}
CurrentPixel.A = (byte)temp;
//and we are done
return CurrentPixel;
}
Enjoy!
Update1: fixed selection bug. The plugin should now be able to apply filter to selected areas.
Update2: fixed transparency bug. It should now render correctly.
Update3: moved to Effects->Renders
Update4: fully fixed transparency "color"