Sign in to follow this  
Followers 0
toe_head2001

Blur Fill v1.4.1 (Jan 17, 2016)

21 posts in this topic

Blur Fill

 

Effects -> Fill -> Blur Fill

ui.png

Before (image surrounded by transparency):

blurfill-before.png

After:

blurfill-after.png

 

Features

  • Fill the transparent area of the canvas with a scaled (fixed ratio) copy of the trimmed image.

 

Notes

Regarding the 'Position Adjust' sliders: The background is scaled at a fixed ratio to fill the canvas, thus only one dimension will be clipped and that dimension's slider is the only one that will have an affect. If the ratio of the canvas and the ratio of the trimmed image are exactly the same, no clipping will happen and thus neither slider will have an affect.

 

Changelog

v1.4.1 (Jan 17, 2017)

  • Fixed: In some cases, the effect would crash with a Read AccessViolationException.

v1.4 (Dec 31, 2016)

  • Fixed: The bottom pixels and the right pixel were getting clipped.
  • Changed: The panning control now uses 3 decimal places, instead of 2.

v1.3 (Jan 12, 2016)

  • New: You can now run the effect on a selection.
  • New: Added an icon to the plugin

v1.2 (Nov 7, 2015)

  • Fixed: Effect would crash if run on an absolutely transparent canvas.

v1.1 (Oct 3, 2015)

  • New: Added a checkbox to make keeping the original image optional
  • Changed: Moved some code into OnSetRenderInfo. Makes the effect faster and use less memory, as it no longer runs the same code over and over again

v1.0 (Aug 25, 2015)

  • Initial release

 

Download

:RightArrowBlue:  BlurFill.zip

 

 

Example - 16:9 Movie Banner

alamo.png

 

Source Code

Source files and Git history

 

Icon based on icons from Fugue Icons.

7

Share this post


Link to post
Share on other sites

An interesting effect. I will play with it in the evening.

0

Share this post


Link to post
Share on other sites

Very cool!  I like this idea.  :star: :star: :star: :star:

0

Share this post


Link to post
Share on other sites

Very nice! You could add some variations like zoom blur, pixelate, distortions, ...  :)

0

Share this post


Link to post
Share on other sites

Very nice! You could add some variations like zoom blur, pixelate, distortions, ...  :)

 

Yes, if people want them, I don't see why not. Would I have to change the plugin name?

 

I would not allow more than one at a time though. (e.g. Pixel + Gaussian blur + ect.) That would just make the code too complex, and probably a lot slower.

0

Share this post


Link to post
Share on other sites

Some name ideas:

 

 Zoom Blur Fill

 Twist and Zoom Fill

 Pixelated Fill

 Cristalized Fill

 Frosted Fill

 

Hurry up! You have got till the end of the day.  :D  

0

Share this post


Link to post
Share on other sites

I like the name Blur Fill. Accurate and elegant. Why change it because you're adding options?

0

Share this post


Link to post
Share on other sites

Teo_head2001! Thank you so much. 

 

*Self photographed.

 

yovkzj6p.png

2

Share this post


Link to post
Share on other sites

Very nice soft result with this Plugin :) .  I added a bit of posterize as well.

 

Blur%20Fill%202_zpsdirxj8h0.png

 

That kitty looks so sad in your sig that I want to adopt it :D .

 

0

Share this post


Link to post
Share on other sites

Version v1.1 posted, and it's a whole a lot faster. My largest test image went from 48 seconds to 2.5 seconds. Of course your results will vary, as it depends on the dimensions of the canvas and the amount of transparency you have around your image... not to mention your hardware.

 

Don't like Blur? Duplicate your layer, and then run the plugin on your bottom copy without "Keep original image" and Blur set to 0. You are then free to run whatever effect you want on it. Pixelate, polar inversion, ect.

 

Example:

starry-night.png

 

Pixelate on bottom layer.

Drop Shadow on the top layer.

Edited by toe_head2001
1

Share this post


Link to post
Share on other sites

If you accidentally apply 'Blur Fill' for the absolutely transparent image, then you will get an error message.

 

BF_err.png

 

The full text of messages:

Hidden Content:

File: C:\Program Files\paint.net\Effects\BlurFill.dll
Name: BlurFillEffect.BlurFill
Version: 1.1.0.0
Author: Copyright © 2015 toe_head2001
Copyright:
Website: http://www.getpaint.net/redirect/plugins.html
Full error message: PaintDotNet.WorkerThreadException: Worker thread threw an exception ---> System.NullReferenceException: Object reference not set to an instance of an object.
at PaintDotNet.Surface.CopyFromBitmap(Bitmap bitmap, Boolean detectDishonestAlpha) in d:\src\pdn\paintdotnet\src\Core\Surface.cs:line 877
at BlurFillEffect.BlurFill.OnSetRenderInfo(PropertyBasedEffectConfigToken newToken, RenderArgs dstArgs, RenderArgs srcArgs)
at PaintDotNet.Effects.Effect`1.OnSetRenderInfo(EffectConfigToken parameters, RenderArgs dstArgs, RenderArgs srcArgs) in d:\src\pdn\paintdotnet\src\Effects\Effect`1.cs:line 67
at PaintDotNet.Effects.BackgroundEffectRenderer.ThreadFunction() in d:\src\pdn\paintdotnet\src\PaintDotNet\Effects\BackgroundEffectRenderer.cs:line 220
--- End of inner exception stack trace ---
at PaintDotNet.Effects.BackgroundEffectRenderer.DrainExceptions() in d:\src\pdn\paintdotnet\src\PaintDotNet\Effects\BackgroundEffectRenderer.cs:line 431
at PaintDotNet.Effects.BackgroundEffectRenderer.Abort() in d:\src\pdn\paintdotnet\src\PaintDotNet\Effects\BackgroundEffectRenderer.cs:line 387
at PaintDotNet.Effects.BackgroundEffectRenderer.Start() in d:\src\pdn\paintdotnet\src\PaintDotNet\Effects\BackgroundEffectRenderer.cs:line 333
at PaintDotNet.Menus.EffectMenuBase.<>c__DisplayClass31.<>c__DisplayClass35.<RunEffectImpl>b__25() in d:\src\pdn\paintdotnet\src\PaintDotNet\Menus\EffectMenuBase.cs:line 1003

 

1

Share this post


Link to post
Share on other sites

If you accidentally apply 'Blur Fill' for the absolutely transparent image, then you will get an error message.

 

Version v1.2 posted. It will now check if the Trimmed Bitmap is null, and no longer crash. Sorry it took me so long to push out this update... kind of forgot about your post until this evening...

2

Share this post


Link to post
Share on other sites

Thanks for the update, Kalama.

 

Now the effect works well.

0

Share this post


Link to post
Share on other sites

Version 1.4 posted.

Fixes an off-by-one bug where the bottom pixels and the right pixels were being clipped. Panning should also have a bit more precision; I switched from using int types to float types in a few places, and the pan control now has 3 decimal places.

4

Share this post


Link to post
Share on other sites

Toe_head2001,

 

I have got a crash. I selected the entire canvas and reduced the size and reduced my image as in the screen shot. I forgot to deselect it and paint.net crashed when I launched the effect. What is weird is that if the image is larger as in the second image, Paint.net does not crash.  

 

If I deselect the image, the effect launches and renders but the position adjustment does not work as in the third image.

Spoiler

blurfill-error-51634d1.png

 

blurfill-error-02-5163515.png

 

blurfill-error-03-5163567.png

 

File: C:\Program Files\Paint.NET\Effects\BlurFill.dll

      Name: BlurFillEffect.BlurFill

      Version: 1.3.0.0

      Author: Copyright © 2015 toe_head2001

      Copyright:

      Website: http://www.getpaint.net/redirect/plugins.html

      Full error message: PaintDotNet.WorkerThreadException: Worker thread threw an exception ---> System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

   at System.Runtime.InteropServices.Marshal.CopyToManaged(IntPtr source, Object destination, Int32 startIndex, Int32 length)

   at BlurFillEffect.BlurFill.TrimBitmap(Bitmap source, Double ratio, Double offsetX, Double offsetY)

   at BlurFillEffect.BlurFill.OnSetRenderInfo(PropertyBasedEffectConfigToken newToken, RenderArgs dstArgs, RenderArgs srcArgs)

   at PaintDotNet.Effects.Effect`1.OnSetRenderInfo(EffectConfigToken parameters, RenderArgs dstArgs, RenderArgs srcArgs) in D:\src\pdn\src\Effects\Effect`1.cs:line 65

   at PaintDotNet.Effects.BackgroundEffectRenderer.ThreadFunction() in D:\src\pdn\src\PaintDotNet\Effects\BackgroundEffectRenderer.cs:line 224

   --- End of inner exception stack trace ---

   at PaintDotNet.Effects.BackgroundEffectRenderer.DrainExceptions() in D:\src\pdn\src\PaintDotNet\Effects\BackgroundEffectRenderer.cs:line 418

   at PaintDotNet.Effects.BackgroundEffectRenderer.Abort() in D:\src\pdn\src\PaintDotNet\Effects\BackgroundEffectRenderer.cs:line 373

   at PaintDotNet.Effects.BackgroundEffectRenderer.Start() in D:\src\pdn\src\PaintDotNet\Effects\BackgroundEffectRenderer.cs:line 319

   at PaintDotNet.Menus.EffectMenuBase.<>c__DisplayClass42_5.<RunEffectImpl>b__4() in D:\src\pdn\src\PaintDotNet\Menus\EffectMenuBase.cs:line 1003

 

0

Share this post


Link to post
Share on other sites

@Eli, that's a very peculiar crash, as the Selection should not have any bearing on that specific section of code.

I've fixed (more of a work-around) the issue though. I sent you a test build, and if it works well for you, I'll officially release it this evening.

 

 

22 hours ago, Eli said:

... but the position adjustment does not work as in the third image.

The ratio of the Canvas and the ratio of the Image are the same; thus it's a perfect fit and there's nothing to adjust.

0

Share this post


Link to post
Share on other sites
1 hour ago, toe_head2001 said:

I've fixed (more of a work-around) the issue though. I sent you a test build, and if it works well for you, I'll officially release it this evening.

It does not crash anymore.Though I tried hard. :) 

 

1 hour ago, toe_head2001 said:

The ratio of the Canvas and the ratio of the Image are the same; thus it's a perfect fit and there's nothing to adjust.

I should have thought of that. :mrred:

0

Share this post


Link to post
Share on other sites

Version 1.4.1 posted to fix the crash encountered by @Eli.

2

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