Jump to content
How to Install Plugins ×
Paint.NET 5.1 is now available! ×

Recommended Posts

Posted (edited)

Quick Alpha->Alpha to Gray

Quick Alpha->Clipboard to Alpha, multiply

Quick Alpha->Clipboard to Alpha, overwrite

Quick Alpha->Gray to Alpha, primary color

Quick Alpha->Gray to Alpha, retain color

Quick Alpha->Remove Alpha

Quick Alpha->Silhouette, primary color

 

Download:

F_QuickAlpha.zip

 

Description:

I made myself a single click, no options -set of alpha handling plugins quite long ago, but I figured I'd share them.

 

Note: these plugins do nothing that other existing plugins couldn't accomplish but for my workflow having them in a single menu, with a single click, with no UI is very useful - the vast majority of time I do not require all the extra features and settings many plugins offer and having to select layers and parameters slows me down a lot. That is also why they go into their own menu folder.

 

Alpha to Gray

Similar to: BoltBait's Alpha to Gray

Converts the current layer's alpha channel into grayscale values. Original color data and alpha channel are removed.

pRPTIWk.png

Clipboard to Alpha

Similar to: BoltBait's Paste Alpha, illnab1024's Alpha Mask Import

The current image on the clipboard is scaled to the image's dimensions (note: NOT the selection's!) and converted to grayscale by averaging the color values.

Overwrite inserts it into the alpha channel. If nothing usable is on the clipboard, nothing happens.

8rKwM29.png

Multiply mode instead blends it with the existing alpha channel by multiplying the values.

DusikHH.png

Gray to Alpha

Similar to: BoltBait's Gray to Alpha / Apply Alpha Mask, Rider01's Alphalizer

Interprets the current layer as grayscale by averaging the color values and puts that into the alpha channel.

Primary color mode replaces all color data with the current primary color, ignoring the color's own alpha.

ys1Rnom.png

Retain color does not replace color data.

EOBUcXB.png 

Remove Alpha

Similar to: a whole lot of plugins

Simply sets the alpha to fully opaque. Color is retained.

q3b6fKV.png

Silhouette, primary color

Similar to: Mike Ryan's Silhouette Plus

Keeps alpha and sets color to primary color, ignoring the color's own alpha. Same as Alpha to Gray followed by Gray to Alpha, primary.

C1Bm955.png

 

Change log:

  • Version 1.1, 2024-11-19:
    • Added Silhouette, primary color.
  • Version 1.0, 2024-10-18:
    • Initial release.
Edited by frio
Added Silhouette, primary color
  • Like 1
  • Upvote 5
Posted

Once thing I noticed is that you're using IClipboardService.TryGetImage() and then copying it directly into a BGRA32 bitmap. TryGetImage() does not necessarily provide a BGRA32 bitmap! So this will either fail or it might even crash.

 

If you want a guaranteed BGRA32 bitmap, use TryGetImageBgra32() or TryGetImage<ColorBgra32>() (they're equivalent)

  • Thanks 1

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Posted
3 minutes ago, Rick Brewster said:

If this is using new 5.1 APIs, then I'll move it to Plugin Developer's Central for now. Once 5.1 stable is released, I'll move it back. (remind me if I forget)

Alright, gotcha!  I made these a while back but they had had no author info or anything since they were for private use, when I recompiled them I had to change the ones accessing the clipboard/primary color, the others weren't using anything that changed, but best keep them in a bundle.

 

2 minutes ago, Rick Brewster said:

If you want a guaranteed BGRA32 bitmap, use TryGetImageBgra32() or TryGetImage<ColorBgra32>() (they're equivalent)

 

Understood, I'll change that up and reupload in a bit.

  • 4 weeks later...
Posted
On 10/18/2024 at 8:32 PM, Rick Brewster said:

Once 5.1 stable is released, I'll move it back. (remind me if I forget)

Reminder!

  • frio changed the title to Quick alpha toolkit (v1.1, updated: 19 Nov 2024)
Posted

V1.1 update: added Silhouette, primary color. I realized "keep alpha but change all color to primary" happens often enough for me to warrant a variant.

  • Like 1
  • Upvote 1

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