Jump to content

Color adjustments black and white


Recommended Posts

Is there an easy way to make a picture black and white according to the highest color value (like the following)

 

Pixel with color 1DEA10 to EAEAEA

Pixel with color 6B6B6B to 6B6B6B

Pixel with color 59E8E8 to E8E8E8

 

Just takes the highest color value and assign that to all color values of that pixel

Edited by ILOVEUIHATEU
Link to comment
Share on other sites

  • ILOVEUIHATEU changed the title to Color adjustments black and white

The Split Color and Brightness plugin will do that. Set Display to Brightness and Blending Mode to Multiply.

 

I believe there are some other plugins that can do that, also. I don't think there's any way to do so without using a plugin. In particular (even though it seems like it should work), I don't think that's what you get if you set Saturation to zero in the built-in Hue/Saturation Adjustment, though I'm not sure. That might be the first thing to try. I'll try to test that out later today, since it would be useful to know.

 

EDIT: No. Unfortunately, setting Saturation to zero in the built-in Hue/Saturation Adjustment would not give you what you want.

  • Like 1
Link to comment
Share on other sites

Download and install this plugin: CodeLab.

 

Open the plugin from the Effects > Advanced menu

 

Paste this code into the editing window (completely replace the stuff that is there by default).

 

// Name:
// Submenu:
// Author:
// Title:
// Version:
// Desc:
// Keywords:
// URL:
// Help:
#region UICode
#endregion

void Render(Surface dst, Surface src, Rectangle rect)
{

    ColorBgra currentPixel;
    byte R, G ,B;

    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];
            // TODO: Add pixel processing code here
            // Access RGBA values this way, for example:
            R = currentPixel.R;
            G = currentPixel.G;
            B = currentPixel.B;

            R= Math.Max(R,G);
            R= Math.Max(R,B);

            dst[x,y] = ColorBgra.FromBgra(R,R,R,currentPixel.A);
        }
    }
}

 

You're welcome :)...and welcome to the forum!

 

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