TechnoRobbo Posted July 21, 2013 Share Posted July 21, 2013 (edited) TR's B&W Photo Back in the day B&W Photographers used Color Filters to reinterpret the way color became greyscale. Photographers like Ansel Adams shooting with huge accordian View Cameras used high F-Stops which produced realy cool hotspots in the center of the B&W Image. (Ansel Adams was also quite partial to using red and yellow filters to darken the sky). This plugin simulates the use of color filters and hot spots in B&W photography. Menu: Effect->Color Demo Video Filter Examples untouched Original B&W with Red Filter w/hotspot The Code // Submenu: Color // Name: TR's B&W Photo // Title: TR's B&W Photo - v1.0 // Author: TechnoRobbo // URL: http://www.technorobbo #region UICode byte Amount1 = 0; // [1] Color Filters|Red Filter|Green Filter|Blue Filter|Cyan Filter|Magenta|Yellow Filter double Amount2 = 0.75; // [0,1] Hot Spot Effect #endregion void Render(Surface dst, Surface src, Rectangle rect) { Rectangle selection = EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt(); int CenterX = ((selection.Right - selection.Left) / 2)+selection.Left; int CenterY = ((selection.Bottom - selection.Top) / 2)+selection.Top; double maxrad = Math.Sqrt(CenterX * CenterX + CenterY * CenterY); ColorBgra CP; for (int y = rect.Top; y < rect.Bottom; y++) { for (int x = rect.Left; x < rect.Right; x++) { double fade = Math.Sqrt((x-CenterX) * (x-CenterX) + (y-CenterY) * (y-CenterY))/ maxrad; fade *=fade; fade = (1-fade) * Amount2 + 1 - Amount2; CP = src[x,y]; switch (Amount1){ case 0: CP.G= CP.R; break; case 1: CP.R=CP.G; break; case 2: CP.R=CP.B; break; case 3: CP.R= Int32Util.ClampToByte((CP.B + CP.G)/2); break; case 4: CP.R=Int32Util.ClampToByte((CP.R + CP.B)/2); break; case 5: CP.R=Int32Util.ClampToByte((CP.R + CP.G)/2); break; } byte newbyte = Int32Util.ClampToByte((int)(fade * (double)CP.R)); CP.R = newbyte; CP.G =newbyte ; CP.B = newbyte ; CP.A = CP.A; dst[x,y] = CP; } } } TRsBWPhoto.zip Edited December 28, 2015 by TechnoRobbo 1 Quote Go out there and be amazing. Have Fun, TRSome Pretty Pictures Some Cool Plugins Link to comment Share on other sites More sharing options...
Liquify Posted August 14, 2013 Share Posted August 14, 2013 Good job! You seem to have some of the best plugins. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.