Sign in to follow this  
Followers 0
null54

Zoom Blur Deluxe for 4.0

17 posts in this topic

This is Zoom Blur Deluxe recompiled to be compatible with Paint.NET 4.0, no other changes have been made.

 

If I convert this to IndirectUI, will you add it to the first post?

0

Share this post


Link to post
Share on other sites

For some reason, after I copied the DLL to my PDN effects directory, it still didn't show up in my Effects>Blur menu. I built the plugin, myself, and it worked fine. Quite a nice effect, too.

 

In case anyone else has the same problem, here is my build: ZoomBlurDeluxe.zip

 

If no one else has the problem, I'll delete the attachment later.

0

Share this post


Link to post
Share on other sites

For some reason, after I copied the DLL to my PDN effects directory, it still didn't show up in my Effects>Blur menu....

 

Hmm, I had no issue with it.

It is faster than the built-in zoom effect...

In my unscientific testing (both effects at comparable settings) of several 5,000px x 5,000px photos, I found the built-in effect to be faster.

Still, this effect produces slightly different results compared to the built-in effect, so I think I'll keep it.

Edited by toe_head2001
0

Share this post


Link to post
Share on other sites

I have an old dll that crashed PDN and I also download the dll that didn't show up. I tested the one you just posted, it isn't quit the same, but that can be due to so many other things I understand that.

 

I'm about to try a tutorial to see what happens. Thank you so much for just seemingly just throwing one together. :D

0

Share this post


Link to post
Share on other sites

Here's source for a CodeLab version, in case anyone is interested:

 

Hidden Content:
// Name: Zoom Blur Deluxe CL
// Submenu: Blurs
// Author: Kevin Drapel (and MJW)
// Title: Zoom Blur Deluxe CL
// Desc: CodeLab version of Zoom Blur Deluxe
// Keywords:
// URL:
// Help:
#region UICode
int Amount1 = 20; // [0,256] Amount
Pair<double, double> Amount2 = Pair.Create( 0.0 , 0.0 ); // Center
byte Amount3 = 0; // [1] Quality|Low|Medium|High
#endregion

void Render(Surface dst, Surface src, Rectangle rect)
{
    long w = dst.Width;
    long h = dst.Height;

    int amount = Amount1;
    int quality = Amount3;
    long cx = (long)((0.5 * src.Width) * (Amount2.First + 1.0)) << 8;
    long cy = (long)((0.5 * src.Height) * (Amount2.Second + 1.0)) << 8;
    
    long fx, fy;
    long fdx, fdy;
    long tx, ty;
    long rx, ry;
    int sa, sg, sb, sr;
    byte shiftFactor = 2;
    byte shiftFactor2 = 8;
    byte steps = 4;

    switch (quality)
    {
        case 0:
            shiftFactor = 3;
            steps = 8;
            break;
        case 1:
            shiftFactor = 5;
            steps = 32;
            break;
        case 2:
            shiftFactor = 6;
            steps = 64;
            break;
    }

    shiftFactor2 += shiftFactor;

    unsafe
    {
        for (int y = rect.Top; y < rect.Bottom; ++y)
        {
            fy = y << 8;
            fdy = (amount * (cy - fy)) >> shiftFactor2;
    
            ColorBgra* dstPtr = dst.GetPointAddressUnchecked(rect.Left, y);
            ColorBgra* srcPtr = src.GetPointAddressUnchecked(rect.Left, y);
    
            for (int x = rect.Left; x < rect.Right; ++x)
            {
                fx = x << 8;
                fdx = (amount * (cx - fx)) >> shiftFactor2;
    
                tx = fx;
                ty = fy;
    
                sr = sg = sb = sa = 0;
    
                for (int n = 0; n < steps; n++)
                {
                    rx = tx >> 8;
                    ry = ty >> 8;
    
                    if (rx < 0) rx = 0;
                    if (ry < 0) ry = 0;
                    if (rx >= src.Width) rx = src.Width - 1;
                    if (ry >= src.Height) ry = src.Height - 1;
    
                    ColorBgra* srcPtr2 = src.GetPointAddress((int)rx, (int)ry);
    
                    sr += srcPtr2->R * srcPtr2->A;
                    sg += srcPtr2->G * srcPtr2->A;
                    sb += srcPtr2->B * srcPtr2->A;
                    sa += srcPtr2->A;
    
                    tx += fdx;
                    ty += fdy;
                }
    
                sr >>= shiftFactor2;
                sg >>= shiftFactor2;
                sb >>= shiftFactor2;
                sa >>= shiftFactor;
    
                *dstPtr++ = ColorBgra.FromBgra((byte)sb, (byte)sg, (byte)sr, (byte)sa);
            }
        }
    }
}

 

Here's the icon: post-53337-0-10626800-1440045896.png

 

EDIT: At toe_head2001's suggestion, I changed the blur range to 0-255. (toe_head2001 points out that in the original version it's 1-256, but I like the no-blur option, and somehow 255 seems to me to be more sensible as the top of the range. It's easy to change if someone insists it match the original.)

 

EDIT2: At toe_head2001's suggestion, I changed the blur default to 20. I missed that in my first edit. I also changed the top of the range to 256, because my reason for not doing so was silly. I left 0 as the lower range, because I do like the idea of being able to see the image with no blur. (I could make it a do so more efficiently by handling that as a special case.)

Edited by MJW
3

Share this post


Link to post
Share on other sites

If I convert this to IndirectUI, will you add it to the first post?

Yes.

 

In my unscientific testing (both effects at comparable settings) of several 5,000px x 5,000px photos, I found the built-in effect to be faster.

 

That was copied from the original thread, it may have been faster when the effect was first posted in 2007.

 

0

Share this post


Link to post
Share on other sites

Here's source for a CodeLab version, in case anyone is interested...

I was just about to post that... you beat me to it.

 

 

Hey, look at this line:

int Amount1 = 10; // [0,100] Amount
The original source allowed for a zoom range of 1 - 256, and had a default of 20

 

 

Edit:

Here's the IndirectUI dll for those that want it.

ZoomBlurDeluxe.zip

zbd.png

Edited by toe_head2001
3

Share this post


Link to post
Share on other sites

Sorry, toe_head2001. I didn't post the CodeLab version so much so that someone could use it (since they can use the original), but just because I thought someone might use it as the basis for some other variation.

0

Share this post


Link to post
Share on other sites

Thanks for this update.

rotate-ball1-4c6e48b.png

 

(EER inspired me :D ) 

Edited by Eli
1

Share this post


Link to post
Share on other sites

Thanks for the update Null54. Thanks for the code MJW.

0

Share this post


Link to post
Share on other sites

It's working well and thank you Mr. Null :)

 

Nulls%20Lamp_zpswwg1l77a.png

2

Share this post


Link to post
Share on other sites

Good job Pixey, I was trying to do Yellowman's Wall Light a few days ago.

Thank you all for doing your bit at bringing this back.

0

Share this post


Link to post
Share on other sites

Just the first. The second is the source code, of interest only to plugin programmers.

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