BoltBait

Temperature / Tint Adjustment

8 posts in this topic

Due to a request here: http://forums.getpaint.net/index.php?/topic/111023-need-color-temperature-control-equivalent-to-windows-live-photo-gallery/

 

 

I created a Temperature / Tint Adjustment plugin.  It is found under the Adjustment menu.

 

User Interface:

 

TemperatureUI.png

 

Algorithm:

 

Here you can visualize the sliders overlaid on the standard color wheel:

 

TemperatureSliders.png

 

CodeLab Script:

// Name: Temperature/Tint
// Submenu: Adjustment
// Author: BoltBait
// Title: BoltBait's Temperature/Tint v1.3
// Version: 1.3
// Desc: Adjust the Temperature or Tint of a photograph
// Keywords: Temperature|Tint
// URL: http://BoltBait.com/pdn
#region UICode
IntSliderControl Amount1 = 0; // [-20,20] Temperature
IntSliderControl Amount2 = 0; // [-20,20] Tint
CheckboxControl Amount3 = false; // [0,1] Preview original image
#endregion

private byte Clamp2Byte(int iValue)
{
    if (iValue < 0) return 0;
    if (iValue > 255) return 255;
    return (byte)iValue;
}

unsafe void Render(Surface dst, Surface src, Rectangle rect)
{
    for (int y = rect.Top; y < rect.Bottom; y++)
    {
        if (IsCancelRequested) return;
        ColorBgra* srcPtr = src.GetPointAddressUnchecked(rect.Left, y);
        ColorBgra* dstPtr = dst.GetPointAddressUnchecked(rect.Left, y);
        for (int x = rect.Left; x < rect.Right; x++)
        {
            ColorBgra CurrentPixel = *srcPtr;

            if (!Amount3)
            {
                CurrentPixel.R = Clamp2Byte(CurrentPixel.R + Amount1); // Temperature
                CurrentPixel.B = Clamp2Byte(CurrentPixel.B - Amount1); // Temperature
                CurrentPixel.G = Clamp2Byte(CurrentPixel.G + Amount2); // Tint
            }

            *dstPtr = CurrentPixel;
            srcPtr++;
            dstPtr++;
        }
    }
}

 

Download:

 

Download as part of my plugin pack, here: http://forums.getpaint.net/index.php?/topic/32048-v

 

 

Support:

 

This plugin is for paint.net 4.0.6+

 

If you are running Paint.NET 3.5.11, you can build your own copy using the CodeLab source above.  You'll need to update the UICode region by replacing "IntSliderControl" with "int" and "CheckboxControl" with "bool".  Or, if CodeLab scares you, download the 3.5.11 version here: http://forums.getpaint.net/index.php?/topic/111031-temperature-tint-adjustment/&do=findComment&comment=527785

 

9

Share this post


Link to post
Share on other sites

<3 Sir BB! 

 

Thanks for posting this awesome tut. :beer: :pizza:

0

Share this post


Link to post
Share on other sites

This is a great Plugin @BoltBait and thank you :pizza:.  Perfect for getting a very subtle change in color on photos and will have many other uses as well.

 

uDdrfvn.png

Before

 

 

uwR2Fvp.png

After

 

 

4

Share this post


Link to post
Share on other sites

Thanks for the code, BoltBait! :beer:

Is it okay if I post a zip with a 3.5.11 compilation for those who may not have (or may be afraid of) CodeLab?

0

Share this post


Link to post
Share on other sites

Sure, go ahead and post it.

0

Share this post


Link to post
Share on other sites
17 hours ago, BoltBait said:

If you are running Paint.NET 3.5.11, you can build your own copy using the CodeLab source above.  You'll need to update the UICode region by replacing "IntSliderControl" with "int" and "CheckboxControl" with "bool".

 

 

Thanks for the info BoltBait. I downloaded CodeLab v1.8 and made my own v3.5.11 compatible dll with my own icon. I did it in Linux under wine. It was touch and go for a while, but I managed to make a working version.

0

Share this post


Link to post
Share on other sites

A useful addition to my adjustment plugins, thanks for the work. 

0

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