Jump to content
How to Install Plugins ×

TR's B&W Photo


TechnoRobbo

Recommended Posts

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


 


 


BWPhotoMenu.png?raw=1


 


 


Demo Video



 


 


Filter Examples


BWCOMPARE.png?raw=1


 


 


untouched Original


ColorPhoto.png?raw=1


 


B&W with Red Filter w/hotspot


BWPhoto.png?raw=1


 


 


 


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 by TechnoRobbo
  • Upvote 1

Go out there and be amazing. Have Fun, TR
TRsSig.png?raw=1
Some Pretty Pictures Some Cool Plugins

Link to comment
Share on other sites

  • 4 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...