Jump to content

Sharpen Classic (for Paint.NET v5.0+)


Recommended Posts

The Photo > Sharpen effect was rewritten for Paint.NET v5.0 and several people have requested the old sharpen effect back.  So, here it is:

 

This is the "classic" (pre v5.0) version of Photo > Sharpen.

 

Download

SharpenClassic.zip

 

Download this zip file to your desktop.  Unzip it.  Run the included Install_SharpenClassic batch file.

 

After install, you should find the effect in the Effects > Photo menu under the name of "Sharpen Classic".

 

By the way, there's no need to download from here as this plugin is now part of BoltBait's Plugin Pack.

 

Source

 

CodeLab script:

 

Spoiler
// Name: Sharpen Classic
// Submenu: Photo
// Author: BoltBait
// Title: BoltBait's Sharpen Classic v1.0
// Version: 1.0
// Desc: Sharpen without GPU acceleration
// Keywords: sharpen
// URL: https://BoltBait.com/pdn
// Help: Sharpen Classic v1.0\nUI Copyright ©2023 by BoltBait\nSharpen algorithm Copyright ©2013 by Rick Brewster\nAll rights reserved.
#region UICode
IntSliderControl Amount1 = 2; // [1,20] Sharpen Amount
#endregion

SharpenEffect sharpenEffect = new SharpenEffect();
PropertyCollection sharpenProps;

protected override void OnDispose(bool disposing)
{
    if (disposing)
    {
        sharpenEffect?.Dispose(); sharpenEffect = null;
    }

    base.OnDispose(disposing);
}

void PreRender(Surface dst, Surface src)
{
    sharpenEffect.EnvironmentParameters = EnvironmentParameters;
    sharpenProps = sharpenEffect.CreatePropertyCollection();
    PropertyBasedEffectConfigToken sharpenParameters = new PropertyBasedEffectConfigToken(sharpenProps);
    sharpenParameters.SetPropertyValue(SharpenEffect.PropertyNames.Amount, Amount1);
    sharpenEffect.SetRenderInfo(sharpenParameters, new RenderArgs(dst), new RenderArgs(src));
}

void Render(Surface dst, Surface src, Rectangle rect)
{
    sharpenEffect.Render(new Rectangle[1] {rect},0,1);
}

 

 

Enjoy. :beer: B) 👍

   

  • Like 1
  • Upvote 1
  • Hooray 1

Click to play:
j.pngs.pngd.pnga.pngp.png
Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game

Link to comment
Share on other sites

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.

 Share

×
×
  • Create New...