halyavin
Level: Delver
Rank Points: 52
Registered: 02-20-2006
IP: Logged
|
Re: Son of Bride of Watch the Bar VI Unleashed: Barmageddon (0)
I created a script for Paint.NET Code lab plugin replaces all master walls with transparent pixels. Usage: select the whole image, Effects-> Advance-> Code lab, insert the code below, press OK. Click here to view the secret text ×#region UICode
#endregion
bool Check(Surface src, int x, int y, Rectangle selection,
int dx, int dy, int r, int g, int b)
{
return x+dx < selection.Right && y+dy < selection.Bottom &&
src[x+dx,y+dy].R == r && src[x+dx,y+dy].G == g && src[x+dx,y+dy].B == b;
}
void Render(Surface dst, Surface src, Rectangle rect)
{
Rectangle selection = this.EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt();
ColorBgra CurrentPixel;
for (int y = rect.Top; y < rect.Bottom; y++)
{
for (int x = rect.Left; x < rect.Right; x++)
{
CurrentPixel = src[x,y];
bool isMaster = false;
for (int dx = 0; dx < 22 && dx <= (x-selection.Left); dx++)
for (int dy = 0; dy < 22 && dy <= (y-selection.Top); dy++)
if (Check(src, x-dx, y-dy, selection, 0, 0, 0, 0, 0))
{
if (Check(src, x-dx, y-dy, selection, 6, 5, 180, 182, 0))
{
isMaster = true;
}
}
if (isMaster)
{
CurrentPixel.A = 0;
CurrentPixel.R = 0;
CurrentPixel.G = 0;
CurrentPixel.B = 0;
}
dst[x,y] = CurrentPixel;
}
}
}
It usefull when you want to update your findings with recent room image. This way master walls will not paint over your drawings.
|