int Amount1=100; //[0,100]Red int Amount2=100; //[0,100]Green int Amount3=100; //[0,100]Blue 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(); ColorBgra CurrentPixel; byte r,g,b,v,a; float rm, gm, bm, modder, vf; 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]; r = CurrentPixel.R; g = CurrentPixel.G; b = CurrentPixel.B; a = CurrentPixel.A; rm = Amount1/100f; gm = Amount2/100f; bm = Amount3/100f; rm *= r; gm *= g; bm *= b; modder = Amount1+Amount2+Amount3; modder /= 300f; vf = (byte)((rm+gm+bm)/3); vf /= modder; v = (byte)vf; CurrentPixel = ColorBgra.FromBgra(v, v, v, a); dst[x,y] = CurrentPixel; } } } }