Jump to content
How to Install Plugins ×

Eliminate Dark/Light


Recommended Posts

This is very simple effect which allows to eliminate dark or light areas of the image. Good deletes black or white color (as a special case of dark or light, respectively).


The effect has a very simple interface. You can find it under Effects-> Color-> Eliminate Dark/Light.


Download from my PluginPack



Original image:



Eliminate dark areas:



Eliminate light areas:



Below the sourse code for CodeLab.



// Author: ReMake
// Submenu: Color
// Name: Eliminate Dark/Light
// Title: Eliminate Dark/Light v1.0    ReMake 2015
// Desc: The Paint.Net effect eliminating dark or light areas of the image
// Keywords: paint.net|effect|eliminate|dark|light
// URL: http://www.getpaint.net/redirect/plugins.html
#region UICode
byte Amount1 = 0; // [1] Eliminate|Dark|Light

void Render(Surface dst, Surface src, Rectangle rect)
    ColorBgra CurrentPixel;
    for (int y = rect.Top; y < rect.Bottom; y++)
        if (IsCancelRequested) return;
        for (int x = rect.Left; x < rect.Right; x++)
            CurrentPixel = src[x,y];
            int R = CurrentPixel.R;
            int G = CurrentPixel.G;
            int B = CurrentPixel.B;
            int A = CurrentPixel.A;
            if (A != 0)
                  switch (Amount1)
                    case 0: // Dark
                        A = Math.Max(Math.Max(R, G), В);
                    case 1: // Light
                        A = 255 - Math.Min(Math.Min(R, G), В);
            CurrentPixel.A = Int32Util.ClampToByte(A);            
            dst[x,y] = CurrentPixel;



This is аn icon for the effect:  icon.png


P.S. I decided to start a new topic, because the former name of the topic Eliminate Black/Eliminate White was wrong.

  • Upvote 6
Link to comment
Share on other sites

Thanks Mr ReMake!


Thank you so much @Remake.  I loved your last one, so I know I will love this one too :D


Thank you Remake, a useful plugin :)


Congrats on the new release, Remake! hi.gif


Thanks to all. I hope this effect will be useful to many users.

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.

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