Jump to content
How to Install Plugins ×

Zoom Blur Deluxe for 4.0


null54

Recommended Posts

This is Zoom Blur Deluxe recompiled to be compatible with Paint.NET 4.0, no other changes have been made.
The following description is copied from the original thread.
 
zoomblur_paintnet.jpg
 
It is faster than the built-in zoom effect and you can move the center. Enjoy !

License : Same as Paint Dot Net license. (MIT)
 
ZoomBlurDeluxe_4.0.zip
ZoomBlurDeluxeSrc_4.0.zip 

  • Upvote 6

PdnSig.png

Plugin Pack | PSFilterPdn | Content Aware Fill | G'MICPaint Shop Pro Filetype | RAW Filetype | WebP Filetype

The small increase in performance you get coding in C++ over C# is hardly enough to offset the headache of coding in the C++ language. ~BoltBait

 

Link to comment
Share on other sites

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?

(September 25th, 2023)  Sorry about any broken images in my posts. I am aware of the issue.

bp-sig.png
My Gallery  |  My Plugin Pack

Layman's Guide to CodeLab

Link to comment
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.

Link to comment
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

(September 25th, 2023)  Sorry about any broken images in my posts. I am aware of the issue.

bp-sig.png
My Gallery  |  My Plugin Pack

Layman's Guide to CodeLab

Link to comment
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

 



 

SloppySig.png

Link to comment
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
  • Upvote 3
Link to comment
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.

 

PdnSig.png

Plugin Pack | PSFilterPdn | Content Aware Fill | G'MICPaint Shop Pro Filetype | RAW Filetype | WebP Filetype

The small increase in performance you get coding in C++ over C# is hardly enough to offset the headache of coding in the C++ language. ~BoltBait

 

Link to comment
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
  • Upvote 3

(September 25th, 2023)  Sorry about any broken images in my posts. I am aware of the issue.

bp-sig.png
My Gallery  |  My Plugin Pack

Layman's Guide to CodeLab

Link to comment
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.

Link to comment
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.

 



 

SloppySig.png

Link to comment
Share on other sites

  • 3 months later...

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

The following description is copied from the original thread.

 

attachicon.gifZoomBlurDeluxe_4.0.zip

attachicon.gifZoomBlurDeluxeSrc_4.0.zip

 

So do I need everything in both these zips to have the Zoom blur deluxe? And does it all go in Effects? Still learning this stuff....

Link to comment
Share on other sites

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