Jump to content

TR's Bokeh Plugin V2.0 (Dec 12, 2014)


Recommended Posts

TechnoRobbo's Bokeh Plugin


a simulation of the Classic photographic effect


due to complexity - slow renders on larger images


higher the threshold the faster it renders.


 


v2.0+ better threshold control


 


Menu: Effect->Photo


 


BokehMenu.PNG?raw=1


 


 


Video Demo



music by TechnoRobbo


 


Video Demo 2 



 


Bokeh Effect


Lights2.png?raw=1


 


 


Abstract


 


Lights.png?raw=1


 


 


Perth at Night


Perth_at_night.png?raw=1


 


 


The Code


Click to View


Hidden Content:


// Submenu: Photo
// Name: TR's Bokeh
// Title: TR's Bokeh - v1.1
// File Version:1.1
// Author: TechnoRobbo
// URL: http://www.technorobbo

#region UICode
int Amount1 = 16; // [1,128] Size
int Amount2 = 3; // [1,15] Brightness
int Amount3 = 128; // [1,254] Threshold
#endregion



void Render(Surface dst, Surface src, Rectangle rect)
{
Rectangle sel = EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt();
//----------------------------------
Graphics g = new RenderArgs(dst).Graphics;
g.Clip =new Region(rect);
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
//BackGround-------------------------------
System.Drawing.SolidBrush BBrush = new System.Drawing.SolidBrush(System.Drawing.Color.Black);
g.FillRectangle(BBrush , new Rectangle(sel.Top, sel.Left,sel.Width,sel.Height));
BBrush.Dispose();
g.CompositingMode = System.Drawing.Drawing2D.CompositingMode.SourceOver;
//===========================================================================================

System.Drawing.SolidBrush CBrush =new System.Drawing.SolidBrush(ColorBgra.Black);
//System.Drawing.Pen CPen = new System.Drawing.Pen(CBrush ,1);
System.Drawing.Point[] pt = new System.Drawing.Point[0];



ColorBgra CP;
int inc = Amount1;
//Test Variable
//inc=50;
//shape=6;
//End Test
int rad = Amount1;
int rad2 = rad * 2;

for (int y = sel.Top; y < sel.Bottom; y ++)
{
for (int x = sel.Left; x < sel.Right; x ++)
{
CP = src.GetBilinearSampleClamped(x,y);
int intensity = (CP.R | CP.G | CP.;
if (intensity>Amount3){
CP.A =(byte) Amount2;
CBrush = new System.Drawing.SolidBrush(CP);

g.FillEllipse(CBrush, new Rectangle(x-rad, y-rad,rad2,rad2));
}
}//x
}//y
CBrush.Dispose();
g.Dispose();
}
 


TRsBokeh.zip

Edited by TechnoRobbo
  • Upvote 4

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

Link to post
Share on other sites

Welsh,

 

I just uploaded v1.1 threshold based on saturation not intensity - gives better color control 

 

Helen,

here's an image created by drawing dots running plugin drawing more dots running plugin again. Maybe that's what you want, The higher you set the threshold the faster it renders.

 

helens%20example.png?raw=1

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

Link to post
Share on other sites

Welsh

 

This one uses my pixel sharpener to give those bright outlines

WelshVideo.png?raw=1

 

 

 

Weird.  I'd never heard of Bokeh until Monday ... WelshBlue

 

me too!!! I never knew it had a name. I was looking at images of blurs to try and create a simulation and I stumbled on the the name "Bokeh"

 

Super Weird!!!

 

 

... I've been working on a tutorial and gotten this far:

 

th_bokeheffecttutexample.jpg

 

... I'll hold back on finishing it 

 

Nice,  that's Art.  My plugin's a simulation - a tool. No sense in holding back.

Edited by TechnoRobbo

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

Link to post
Share on other sites

if you don't mind I'll go ahead and post it but gear it towards photo manipulation rather than the conventional sense of image.  Your plug-in will do that ... 

 

Welsh,

 

Heck , I don't mind, that's why I publish my source codes - free knowledge for everyone.

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

Link to post
Share on other sites

Thank God, I'm not the only one! :lol:

 

Looks really cool, I'll be playing with it!

Make that three of us. I read it first as 'broken' :/ Looks like it could be a good plug-in to explore.

Decent example DrewDale. It looks like a lot of other plug-in's were used to get that final image.

iNUIdNo.jpg

Link to post
Share on other sites
  • 9 months later...

Hey guys,

I'm here looking for some sort of bokeh-plugin. This one comes close to the real stuff, but it still looks a little generic. (Still awesome to have it, and for free, so thanks a lot!)

 

Here's a page I stumbled upon some time ago, gets interesting in the middle and it even has the source code at the bottom of the page:

http://www.cs.ubc.ca/labs/imager/tr/2012/PolynomialOptics/

 

Any chance you could do an effect like this in paint.net?

Link to post
Share on other sites

I see Bokeh, Star Filter and lens flares. I have a simulation for Bokeh and my GlamourShot is a star diffusion simulation. I do not have a lens flare but it does exist check the plugins index possibly Madjiks pack 

 

 

Edited by TechnoRobbo

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

Link to post
Share on other sites
  • 7 months later...

This is an amazing plugin. I was actually wondering what this effect is called like when you use a DLSR, it blurs the background with these fantastic faded circles from a distance. I was a looking for a way to create it artificially. It turns out its called Bokeh. Gaussian blur just doesn't make a blur as good as this.

 

But it renders kinda slow on my computer, even with considerably low resolution and low quality images. I'm using a netbook with Atom processor and 2GBs RAM but many other plugins just render OK with it. Any way this could be made to render faster?

 

Thanks.

Edited by Ishi
Link to post
Share on other sites

Thanks.

 

But I see so much great potential with this plugin. Its one of a kind. Don't you think, it should be under Effects>Blurs section instead of Effect>Photo? And maybe add a little icon for this.

 

We can finally edit pictures taken from a phone camera or a digital camera and make them look like as if they were taken by a DLSR.

Link to post
Share on other sites
  • 5 months later...
  • 3 years 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...