Sign in to follow this  
Followers 0
TechnoRobbo

TR's Colorizer HMS Plugin

7 posts in this topic

TR's Colorizer HMS Plugin


 


(H=Highlight M=Midtones S=Shadow)


 


Smoothly adjust between 3 Colors to achieve effects from Subtle to Extreme


 


Menu: Effects->Color


 


ColorizerHMSMenu.PNG?raw=1.


 


 


More Mila


ColorizerHMS.png?raw=1


 


 


The Code


 


Hidden Content:



// Submenu: Color
// Name: TR's ColorizerHMS
// Title: TR's ColorizerHMS - v1.0
// Author: TechnoRobbo
// URL: http://www.technorobbo


#region UICode
ColorBgra Amount1 = ColorBgra.FromBgr(0,0,0); // Shadow
ColorBgra Amount2 = ColorBgra.FromBgr(0,0,0); // Mid Tones
ColorBgra Amount3 = ColorBgra.FromBgr(0,0,0); // Highlights
#endregion


void Render(Surface dst, Surface src, Rectangle rect)
{
    
    ColorBgra CP;
    for (int y = rect.Top; y < rect.Bottom; y++)
    {
        for (int x = rect.Left; x < rect.Right; x++)
        {
            CP = src[x,y];
            double ColorAvg=(CP.R + CP.G + CP. /3;
            double interp=Math.Abs(ColorAvg/ 128 - 1);
            if (ColorAvg<128){
                CP.R =(byte)((double)Amount1.R * interp + (double)Amount2.R - (double)Amount2.R * interp);
                  CP.G =(byte)((double)Amount1.G * interp + (double)Amount2.G - (double)Amount2.G * interp);
                  CP.B =(byte)((double)Amount1.B * interp + (double)Amount2.B - (double)Amount2.B * interp);
               }else{
                   CP.R =(byte)((double)Amount3.R * interp + (double)Amount2.R - (double)Amount2.R * interp);
                  CP.G =(byte)((double)Amount3.G * interp + (double)Amount2.G - (double)Amount2.G * interp);
                  CP.B =(byte)((double)Amount3.B * interp + (double)Amount2.B - (double)Amount2.B * interp);
               }
            
            dst[x,y] = CP;
        }
    }
}
 


 


TR'sColorizerHMS.zip

Edited by TechnoRobbo
0

Share this post


Link to post
Share on other sites

I could not resist :D - It even works on a Horse.

horse3_0_zps528414de.jpg

A good plugin by the way :)

1

Share this post


Link to post
Share on other sites

now that's a horse of a different color

0

Share this post


Link to post
Share on other sites

Don't look it in the mouth ;)

0

Share this post


Link to post
Share on other sites

i gotta quit horsin' around and get back to work

0

Share this post


Link to post
Share on other sites

Don't look it in the mouth ;)

 

 

i gotta quit horsin' around and get back to work

 

:lol: I love it on here 

1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0