Sign in to follow this  
Followers 0
TechnoRobbo

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

22 posts in this topic

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
4

Share this post


Link to post
Share on other sites

How do I create the middle image with just the circles? And it takes kind of long to create the effect if the image is detailed, but it's a really nice plugin. Thank you!

0

Share this post


Link to post
Share on other sites

Weird.  I'd never heard of Bokeh until Monday

 

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

 

th_bokeheffecttutexample.jpg

 

... I'll hold back on finishing it 

Edited by welshblue
0

Share this post


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

0

Share this post


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
0

Share this post


Link to post
Share on other sites

Started with This

2.png

 

Ran your plug in to get this:

1.png

 

And after a play around with other plug ins I got this:

idea-1.png

 

A great plug in with many uses, thank you. B)

1

Share this post


Link to post
Share on other sites

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!!!

 

 

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

 

It's one of those names that's so cool you wonder how you didn't know it ;)

 

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 ... 

 

Things like this:

 

th_bokeheffectuk2.jpg th_bokehdigiart.jpg th_bokehcar.jpg

 

... my son is horrified I've used the union jack  :evillaugh:

 

Edit* Nice mix of plug-ins Drew.  Very effective

Edited by welshblue
0

Share this post


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.

0

Share this post


Link to post
Share on other sites

I thought a Bokeh was something you smoke weed out of,lol.   ;)

0

Share this post


Link to post
Share on other sites

I read "TR's Broken Plugin" and thought huh?

 

Cool!

 

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

 

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

0

Share this post


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.

0

Share this post


Link to post
Share on other sites

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?

0

Share this post


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
0

Share this post


Link to post
Share on other sites

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
0

Share this post


Link to post
Share on other sites
Any way this could be made to render faster?

 

I can make it faster but I would have to migrate the code from CodeLab to Visual Studio. I have a couple of other projects right now though.

0

Share this post


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.

0

Share this post


Link to post
Share on other sites

When I transfer it to VS it will, but I have a lot on my plate right now. 

0

Share this post


Link to post
Share on other sites

Version 2.0 - adds a progress bar for larger images

0

Share this post


Link to post
Share on other sites

Version 2.0 - adds a progress bar for larger images

 

@TechnoRobbo! Thanks so much for sharing. 

0

Share this post


Link to post
Share on other sites

thank you TR now i can make my own instead of those weird 'images' you see  <3 it

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0